Mercurial > mplayer.hg
annotate libmpdemux/tvi_def.h @ 9565:e74916774667
Improved RTP packet buffering, by relying on the underlying OS's UDP
socket buffering. Improve A/V sync by dropping packets when one stream
gets too far behind the other. Now tries to figure out the video frame
rate automatically (if "-fps" is not used). Added support for MPEG-4
Elementary Stream video and MPEG-4 Generic audio RTP streams.
author | rsf |
---|---|
date | Tue, 11 Mar 2003 19:08:31 +0000 |
parents | 9fc45fe0d444 |
children | f580a7755ac5 |
rev | line source |
---|---|
3815 | 1 #include <stdlib.h> /* malloc */ |
8123
9fc45fe0d444
*HUGE* set of compiler warning fixes, unused variables removal
arpi
parents:
5572
diff
changeset
|
2 #include <string.h> /* memset */ |
3815 | 3 |
4 static int init(priv_t *priv); | |
2802 | 5 static int uninit(priv_t *priv); |
2790 | 6 static int control(priv_t *priv, int cmd, void *arg); |
2802 | 7 static int start(priv_t *priv); |
5572
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
3815
diff
changeset
|
8 static double grab_video_frame(priv_t *priv, char *buffer, int len); |
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
3815
diff
changeset
|
9 #ifdef HAVE_TV_BSDBT848 |
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
3815
diff
changeset
|
10 static double grabimmediate_video_frame(priv_t *priv, char *buffer, int len); |
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
3815
diff
changeset
|
11 #endif |
2790 | 12 static int get_video_framesize(priv_t *priv); |
5572
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
3815
diff
changeset
|
13 static double grab_audio_frame(priv_t *priv, char *buffer, int len); |
2790 | 14 static int get_audio_framesize(priv_t *priv); |
15 | |
16 static tvi_functions_t functions = | |
17 { | |
18 init, | |
2802 | 19 uninit, |
2790 | 20 control, |
2802 | 21 start, |
2790 | 22 grab_video_frame, |
5572
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
3815
diff
changeset
|
23 #ifdef HAVE_TV_BSDBT848 |
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
3815
diff
changeset
|
24 grabimmediate_video_frame, |
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
3815
diff
changeset
|
25 #endif |
2790 | 26 get_video_framesize, |
27 grab_audio_frame, | |
28 get_audio_framesize | |
29 }; | |
30 | |
31 static tvi_handle_t *new_handle() | |
32 { | |
2819
2e58962dc9fe
cleaned up some warnings, and tv_param_on moved out from #ifdef USE_TV
alex
parents:
2802
diff
changeset
|
33 tvi_handle_t *h = (tvi_handle_t *)malloc(sizeof(tvi_handle_t)); |
2790 | 34 |
35 if (!h) | |
36 return(NULL); | |
2802 | 37 h->priv = (priv_t *)malloc(sizeof(priv_t)); |
2790 | 38 if (!h->priv) |
39 { | |
40 free(h); | |
41 return(NULL); | |
42 } | |
43 memset(h->priv, 0, sizeof(priv_t)); | |
44 h->info = &info; | |
45 h->functions = &functions; | |
2802 | 46 h->seq = 0; |
2941
60c1b7c0ea21
added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents:
2819
diff
changeset
|
47 h->chanlist = -1; |
60c1b7c0ea21
added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents:
2819
diff
changeset
|
48 h->chanlist_s = NULL; |
60c1b7c0ea21
added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents:
2819
diff
changeset
|
49 h->norm = -1; |
60c1b7c0ea21
added support for norm=,chanlist=,channel= and also on-the-fly channel chaning with keys
alex
parents:
2819
diff
changeset
|
50 h->channel = -1; |
2790 | 51 return(h); |
52 } | |
53 | |
54 static void free_handle(tvi_handle_t *h) | |
55 { | |
3611 | 56 if (h) { |
57 if (h->priv) | |
58 free(h->priv); | |
2790 | 59 free(h); |
3611 | 60 } |
2790 | 61 } |