Rev | Line | |
---|
[172] | 1 | //codecfilter_cmd.c: |
---|
| 2 | |
---|
| 3 | #include "roard.h" |
---|
| 4 | |
---|
[196] | 5 | int cf_cmd_open(CODECFILTER_USERDATA_T * inst, int codec, |
---|
| 6 | struct roar_stream_server * info, |
---|
| 7 | struct roar_codecfilter * filter) { |
---|
| 8 | int socks[2]; |
---|
| 9 | |
---|
| 10 | if ( socketpair(AF_UNIX, SOCK_STREAM, 0, socks) == -1 ) { |
---|
| 11 | return -1; |
---|
| 12 | } |
---|
| 13 | |
---|
| 14 | if ( lib_run_bg(filter->options, ((struct roar_stream*)info)->fh, socks[1], ROAR_STDERR) == -1 ) |
---|
| 15 | return -1; |
---|
| 16 | |
---|
[197] | 17 | close(((struct roar_stream*)info)->fh); |
---|
[196] | 18 | ((struct roar_stream*)info)->fh = socks[0]; |
---|
| 19 | ((struct roar_stream*)info)->info.codec = ROAR_CODEC_DEFAULT; |
---|
| 20 | close(socks[1]); |
---|
| 21 | |
---|
| 22 | info->codecfilter = -1; |
---|
| 23 | |
---|
| 24 | return 0; |
---|
| 25 | } |
---|
| 26 | |
---|
[172] | 27 | //ll |
---|
Note: See
TracBrowser
for help on using the repository browser.