Mercurial > mplayer.hg
annotate vidix/vidixlib.h @ 24678:9aab9d7b51f0
Fix missing subtitles after seeking back
Subtitle packets that had been demuxed but whose start time had not
yet been reached were left in the demuxer stream after seeking.
When using the default (non-libass) subtitle rendering this could
block subtitles from appearing as long as the playback position stayed
below the original one before seek. External subtitle files were not
affected.
Fixed by making seek code free all packets from the subtitle stream.
author | uau |
---|---|
date | Thu, 04 Oct 2007 02:35:34 +0000 |
parents | 82216ef041e0 |
children | 3baf6a2283da |
rev | line source |
---|---|
3991 | 1 /* |
23046
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
22902
diff
changeset
|
2 * VIDIX - VIDeo Interface for *niX. |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
22902
diff
changeset
|
3 * Copyright (C) 2002 Nick Kurshev |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
22902
diff
changeset
|
4 * Copyright (C) 2007 Benjamin Zores <ben@geexbox.org> |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
22902
diff
changeset
|
5 * |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
22902
diff
changeset
|
6 * This file is part of MPlayer. |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
22902
diff
changeset
|
7 * |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
22902
diff
changeset
|
8 * MPlayer is free software; you can redistribute it and/or modify |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
22902
diff
changeset
|
9 * it under the terms of the GNU General Public License as published by |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
22902
diff
changeset
|
10 * the Free Software Foundation; either version 2 of the License, or |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
22902
diff
changeset
|
11 * (at your option) any later version. |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
22902
diff
changeset
|
12 * |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
22902
diff
changeset
|
13 * MPlayer is distributed in the hope that it will be useful, |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
22902
diff
changeset
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
22902
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
22902
diff
changeset
|
16 * GNU General Public License for more details. |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
22902
diff
changeset
|
17 * |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
22902
diff
changeset
|
18 * You should have received a copy of the GNU General Public License |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
22902
diff
changeset
|
19 * along with MPlayer; if not, write to the Free Software |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
22902
diff
changeset
|
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
22902
diff
changeset
|
21 * |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
22902
diff
changeset
|
22 * This interface is introduced as universal one to MPEG decoder, |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
22902
diff
changeset
|
23 * Back End Scaler (BES) and YUV2RGB hw accelerators. |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
22902
diff
changeset
|
24 * |
3991 | 25 * In the future it may be expanded up to capturing and audio things. |
26 * Main goal of this this interface imlpementation is providing DGA | |
27 * everywhere where it's possible (unlike X11 and other). | |
23046
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
22902
diff
changeset
|
28 * |
3991 | 29 * This interface is based on v4l2, fbvid.h, mga_vid.h projects |
30 * and personally my ideas. | |
23046
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
22902
diff
changeset
|
31 * |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
22902
diff
changeset
|
32 * NOTE: This interface is introduces as driver interface. |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
22902
diff
changeset
|
33 */ |
82216ef041e0
updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents:
22902
diff
changeset
|
34 |
3991 | 35 #ifndef VIDIXLIB_H |
36 #define VIDIXLIB_H | |
37 | |
38 #ifdef __cplusplus | |
39 extern "C" { | |
40 #endif | |
41 | |
42 #include "vidix.h" | |
43 | |
22857
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
44 typedef struct VDXDriver { |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
45 const char *name; |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
46 struct VDXDriver *next; |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
47 int (* probe) (int verbose, int force); |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
48 int (* get_caps) (vidix_capability_t *cap); |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
49 int (*query_fourcc)(vidix_fourcc_t *); |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
50 int (*init)(void); |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
51 void (*destroy)(void); |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
52 int (*config_playback)(vidix_playback_t *); |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
53 int (*playback_on)( void ); |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
54 int (*playback_off)( void ); |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
55 /* Functions below can be missed in driver ;) */ |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
56 int (*frame_sel)( unsigned frame_idx ); |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
57 int (*get_eq)( vidix_video_eq_t * ); |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
58 int (*set_eq)( const vidix_video_eq_t * ); |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
59 int (*get_deint)( vidix_deinterlace_t * ); |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
60 int (*set_deint)( const vidix_deinterlace_t * ); |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
61 int (*copy_frame)( const vidix_dma_t * ); |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
62 int (*get_gkey)( vidix_grkey_t * ); |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
63 int (*set_gkey)( const vidix_grkey_t * ); |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
64 int (*get_num_fx)( unsigned * ); |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
65 int (*get_fx)( vidix_oem_fx_t * ); |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
66 int (*set_fx)( const vidix_oem_fx_t * ); |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
67 } VDXDriver; |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
68 |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
69 typedef struct VDXContext { |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
70 VDXDriver *drv; |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
71 /* might be filled in by much more info later on */ |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
72 } VDXContext; |
77def5093daf
switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
ben
parents:
4191
diff
changeset
|
73 |
22865
441582f3ed87
simplified function prototypes to avoid casts but keep external API compatibility
ben
parents:
22862
diff
changeset
|
74 typedef VDXContext * VDL_HANDLE; |
3991 | 75 |
76 /* returns library version */ | |
22862 | 77 unsigned vdlGetVersion( void ); |
3991 | 78 |
79 /* Opens corresponded video driver and returns handle | |
80 of associated stream. | |
81 path - specifies path where drivers are located. | |
82 name - specifies prefered driver name (can be NULL). | |
83 cap - specifies driver capability (TYPE_* constants). | |
3995 | 84 verbose - specifies verbose level |
3991 | 85 returns !0 if ok else NULL. |
86 */ | |
22862 | 87 VDL_HANDLE vdlOpen(const char *path,const char *name,unsigned cap,int verbose); |
3991 | 88 /* Closes stream and corresponded driver. */ |
22865
441582f3ed87
simplified function prototypes to avoid casts but keep external API compatibility
ben
parents:
22862
diff
changeset
|
89 void vdlClose(VDL_HANDLE ctx); |
3991 | 90 |
91 /* Queries driver capabilities. Return 0 if ok else errno */ | |
22862 | 92 int vdlGetCapability(VDL_HANDLE, vidix_capability_t *); |
3991 | 93 |
94 /* Queries support for given fourcc. Returns 0 if ok else errno */ | |
22862 | 95 int vdlQueryFourcc(VDL_HANDLE,vidix_fourcc_t *); |
3991 | 96 |
97 /* Returns 0 if ok else errno */ | |
22862 | 98 int vdlConfigPlayback(VDL_HANDLE, vidix_playback_t *); |
3991 | 99 |
100 /* Returns 0 if ok else errno */ | |
22862 | 101 int vdlPlaybackOn(VDL_HANDLE); |
3991 | 102 |
103 /* Returns 0 if ok else errno */ | |
22862 | 104 int vdlPlaybackOff(VDL_HANDLE); |
3991 | 105 |
106 /* Returns 0 if ok else errno */ | |
22862 | 107 int vdlPlaybackFrameSelect(VDL_HANDLE, unsigned frame_idx ); |
3991 | 108 |
109 /* Returns 0 if ok else errno */ | |
22862 | 110 int vdlGetGrKeys(VDL_HANDLE, vidix_grkey_t * ); |
4070
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
3995
diff
changeset
|
111 |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
3995
diff
changeset
|
112 /* Returns 0 if ok else errno */ |
22862 | 113 int vdlSetGrKeys(VDL_HANDLE, const vidix_grkey_t * ); |
4070
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
3995
diff
changeset
|
114 |
b61ba6c256dd
Minor interface changes: color and video keys are moved out from playback configuring
nick
parents:
3995
diff
changeset
|
115 /* Returns 0 if ok else errno */ |
22862 | 116 int vdlPlaybackGetEq(VDL_HANDLE, vidix_video_eq_t * ); |
3991 | 117 |
118 /* Returns 0 if ok else errno */ | |
22862 | 119 int vdlPlaybackSetEq(VDL_HANDLE, const vidix_video_eq_t * ); |
3991 | 120 |
121 /* Returns 0 if ok else errno */ | |
22862 | 122 int vdlPlaybackGetDeint(VDL_HANDLE, vidix_deinterlace_t * ); |
4191 | 123 |
124 /* Returns 0 if ok else errno */ | |
22862 | 125 int vdlPlaybackSetDeint(VDL_HANDLE, const vidix_deinterlace_t * ); |
4191 | 126 |
127 /* Returns 0 if ok else errno */ | |
22862 | 128 int vdlQueryNumOemEffects(VDL_HANDLE, unsigned * number ); |
4191 | 129 |
130 /* Returns 0 if ok else errno */ | |
22862 | 131 int vdlGetOemEffect(VDL_HANDLE, vidix_oem_fx_t * ); |
4191 | 132 |
133 /* Returns 0 if ok else errno */ | |
22862 | 134 int vdlSetOemEffect(VDL_HANDLE, const vidix_oem_fx_t * ); |
4191 | 135 |
136 | |
137 /* Returns 0 if ok else errno */ | |
22862 | 138 int vdlPlaybackCopyFrame(VDL_HANDLE, const vidix_dma_t * ); |
3991 | 139 |
140 #ifdef __cplusplus | |
141 } | |
142 #endif | |
143 | |
144 #endif |