annotate libvo/vo_mpegpes.c @ 12592:0ec26eeb8624

typo
author diego
date Tue, 15 Jun 2004 18:44:11 +0000
parents 0694a2fba3dd
children 2f150c190f7a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5059
8914f0bb6f35 using libFAME...
arpi
parents: 4737
diff changeset
1 // Don't change for DVB card, it must be 2048
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
2 #define PES_MAX_SIZE 2048
5059
8914f0bb6f35 using libFAME...
arpi
parents: 4737
diff changeset
3
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
4 /*
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
5 * Based on:
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
6 *
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
7 * test_av.c - Test program for new API
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
8 *
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
9 * Copyright (C) 2000 Ralph Metzler <ralph@convergence.de>
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
10 * & Marcus Metzler <marcus@convergence.de>
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
11 * for convergence integrated media GmbH
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
12 *
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
13 * libav - MPEG-PS multiplexer, part of ffmpeg
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
14 * Copyright Gerard Lantau (see http://ffmpeg.sf.net)
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
15 *
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
16 */
1871
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
17
6239
22cf38f95151 warning fix (write()/close() require unistd.h)
pl
parents: 5881
diff changeset
18 #include "config.h"
1871
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
19 #include <stdio.h>
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
20 #include <stdlib.h>
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
21 #include <string.h>
4737
32e1f5042f65 I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents: 4596
diff changeset
22 #include <errno.h>
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
23 #include <sys/types.h>
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
24 #include <sys/stat.h>
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
25 #include <fcntl.h>
6239
22cf38f95151 warning fix (write()/close() require unistd.h)
pl
parents: 5881
diff changeset
26 #include <unistd.h>
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
27
5877
93de400ad48e libfame code removed (use -vop fame/-vop lavc), init code moved to preinit, height checks added to config()
arpi
parents: 5844
diff changeset
28 #include "mp_msg.h"
8594
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
29 #ifdef HAVE_DVB_HEAD
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
30 #define HAVE_DVB 1
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
31 #endif
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
32 #ifdef HAVE_DVB
8594
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
33 #ifndef HAVE_DVB_HEAD
2066
2b14cad013b7 using poll() only for DVB card - not required for file write
arpi
parents: 1986
diff changeset
34 #include <sys/poll.h>
2b14cad013b7 using poll() only for DVB card - not required for file write
arpi
parents: 1986
diff changeset
35
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
36 #include <sys/ioctl.h>
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
37 #include <stdio.h>
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
38 #include <time.h>
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
39
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
40 #include <ost/dmx.h>
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
41 #include <ost/frontend.h>
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
42 #include <ost/sec.h>
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
43 #include <ost/video.h>
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
44 #include <ost/audio.h>
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
45
8594
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
46 #else
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
47 #define true 1
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
48 #define false 0
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
49 #include <sys/poll.h>
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
50
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
51 #include <sys/ioctl.h>
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
52 #include <stdio.h>
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
53 #include <time.h>
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
54
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
55 #include <linux/dvb/dmx.h>
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
56 #include <linux/dvb/frontend.h>
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
57 #include <linux/dvb/video.h>
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
58 #include <linux/dvb/audio.h>
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
59 #endif
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
60 #endif
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
61
1871
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
62 #include "config.h"
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
63 #include "video_out.h"
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
64 #include "video_out_internal.h"
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
65
1872
2fe0e11bab3c file writer implemented
arpi
parents: 1871
diff changeset
66 int vo_mpegpes_fd=-1;
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
67 int vo_mpegpes_fd2=-1;
1872
2fe0e11bab3c file writer implemented
arpi
parents: 1871
diff changeset
68
8148
5b39e79af5fe removed get_info, using the same sheme as in libmpcodecs instead
alex
parents: 7860
diff changeset
69 static vo_info_t info =
1871
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
70 {
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
71 #ifdef HAVE_DVB
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
72 "Mpeg-PES to DVB card",
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
73 #else
1871
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
74 "Mpeg-PES file",
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
75 #endif
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
76 "mpegpes",
1871
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
77 "A'rpi",
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
78 ""
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
79 };
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
80
8148
5b39e79af5fe removed get_info, using the same sheme as in libmpcodecs instead
alex
parents: 7860
diff changeset
81 LIBVO_EXTERN (mpegpes)
5b39e79af5fe removed get_info, using the same sheme as in libmpcodecs instead
alex
parents: 7860
diff changeset
82
1871
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
83 static uint32_t
7124
eca7dbad0166 finally removed query_vaa, bes_da and vo_tune_info - the obsoleted libvo api
alex
parents: 6273
diff changeset
84 config(uint32_t s_width, uint32_t s_height, uint32_t width, uint32_t height, uint32_t fullscreen, char *title, uint32_t format)
1871
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
85 {
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
86 #ifdef HAVE_DVB
5877
93de400ad48e libfame code removed (use -vop fame/-vop lavc), init code moved to preinit, height checks added to config()
arpi
parents: 5844
diff changeset
87 switch(s_height){
93de400ad48e libfame code removed (use -vop fame/-vop lavc), init code moved to preinit, height checks added to config()
arpi
parents: 5844
diff changeset
88 case 288:
93de400ad48e libfame code removed (use -vop fame/-vop lavc), init code moved to preinit, height checks added to config()
arpi
parents: 5844
diff changeset
89 case 576:
93de400ad48e libfame code removed (use -vop fame/-vop lavc), init code moved to preinit, height checks added to config()
arpi
parents: 5844
diff changeset
90 case 240:
93de400ad48e libfame code removed (use -vop fame/-vop lavc), init code moved to preinit, height checks added to config()
arpi
parents: 5844
diff changeset
91 case 480:
93de400ad48e libfame code removed (use -vop fame/-vop lavc), init code moved to preinit, height checks added to config()
arpi
parents: 5844
diff changeset
92 break;
93de400ad48e libfame code removed (use -vop fame/-vop lavc), init code moved to preinit, height checks added to config()
arpi
parents: 5844
diff changeset
93 default:
93de400ad48e libfame code removed (use -vop fame/-vop lavc), init code moved to preinit, height checks added to config()
arpi
parents: 5844
diff changeset
94 mp_msg(MSGT_VO,MSGL_ERR,"DVB: height=%d not supported (try 240/480 (ntsc) or 288/576 (pal)\n",s_height);
93de400ad48e libfame code removed (use -vop fame/-vop lavc), init code moved to preinit, height checks added to config()
arpi
parents: 5844
diff changeset
95 return -1;
93de400ad48e libfame code removed (use -vop fame/-vop lavc), init code moved to preinit, height checks added to config()
arpi
parents: 5844
diff changeset
96 }
93de400ad48e libfame code removed (use -vop fame/-vop lavc), init code moved to preinit, height checks added to config()
arpi
parents: 5844
diff changeset
97 #endif
93de400ad48e libfame code removed (use -vop fame/-vop lavc), init code moved to preinit, height checks added to config()
arpi
parents: 5844
diff changeset
98 return 0;
93de400ad48e libfame code removed (use -vop fame/-vop lavc), init code moved to preinit, height checks added to config()
arpi
parents: 5844
diff changeset
99 }
93de400ad48e libfame code removed (use -vop fame/-vop lavc), init code moved to preinit, height checks added to config()
arpi
parents: 5844
diff changeset
100
93de400ad48e libfame code removed (use -vop fame/-vop lavc), init code moved to preinit, height checks added to config()
arpi
parents: 5844
diff changeset
101 static uint32_t preinit(const char *arg){
93de400ad48e libfame code removed (use -vop fame/-vop lavc), init code moved to preinit, height checks added to config()
arpi
parents: 5844
diff changeset
102 #ifdef HAVE_DVB
7672
e6b46875e1b9 - fixed a 10l bug: setting PTS flag even if no PTS stored
arpi
parents: 7124
diff changeset
103 if(!arg){
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
104 //|O_NONBLOCK
8594
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
105 #ifndef HAVE_DVB_HEAD
8917
arpi
parents: 8594
diff changeset
106 printf("Opening /dev/ost/video+audio\n");
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
107 if((vo_mpegpes_fd = open("/dev/ost/video",O_RDWR)) < 0){
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
108 perror("DVB VIDEO DEVICE: ");
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
109 return -1;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
110 }
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
111 if((vo_mpegpes_fd2 = open("/dev/ost/audio",O_RDWR|O_NONBLOCK)) < 0){
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
112 perror("DVB AUDIO DEVICE: ");
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
113 return -1;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
114 }
8594
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
115 #else
8917
arpi
parents: 8594
diff changeset
116 printf("Opening /dev/dvb/adapter0/video0+audio0\n");
8594
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
117 if((vo_mpegpes_fd = open("/dev/dvb/adapter0/video0",O_RDWR)) < 0){
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
118 perror("DVB VIDEO DEVICE: ");
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
119 return -1;
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
120 }
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
121 if((vo_mpegpes_fd2 = open("/dev/dvb/adapter0/audio0",O_RDWR|O_NONBLOCK)) < 0){
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
122 perror("DVB AUDIO DEVICE: ");
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
123 return -1;
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
124 }
00326905484b DVB-HEAD (aka. NEWSTRUCT) detection & support
arpi
parents: 8148
diff changeset
125 #endif
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
126 if ( (ioctl(vo_mpegpes_fd,VIDEO_SET_BLANK, false) < 0)){
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
127 perror("DVB VIDEO SET BLANK: ");
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
128 return -1;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
129 }
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
130 if ( (ioctl(vo_mpegpes_fd,VIDEO_SELECT_SOURCE, VIDEO_SOURCE_MEMORY) < 0)){
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
131 perror("DVB VIDEO SELECT SOURCE: ");
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
132 return -1;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
133 }
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
134 #if 1
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
135 if ( (ioctl(vo_mpegpes_fd2,AUDIO_SELECT_SOURCE, AUDIO_SOURCE_MEMORY) < 0)){
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
136 perror("DVB AUDIO SELECT SOURCE: ");
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
137 return -1;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
138 }
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
139 if ( (ioctl(vo_mpegpes_fd2,AUDIO_PLAY) < 0)){
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
140 perror("DVB AUDIO PLAY: ");
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
141 return -1;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
142 }
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
143 #else
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
144 if ( (ioctl(vo_mpegpes_fd2,AUDIO_STOP,0) < 0)){
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
145 perror("DVB AUDIO STOP: ");
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
146 return -1;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
147 }
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
148 #endif
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
149 if ( (ioctl(vo_mpegpes_fd,VIDEO_PLAY) < 0)){
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
150 perror("DVB VIDEO PLAY: ");
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
151 return -1;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
152 }
7860
0432eeab8f1e re-enabled a-v sync
arpi
parents: 7672
diff changeset
153 if ( (ioctl(vo_mpegpes_fd2,AUDIO_SET_AV_SYNC, true) < 0)){
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
154 perror("DVB AUDIO SET AV SYNC: ");
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
155 return -1;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
156 }
7672
e6b46875e1b9 - fixed a 10l bug: setting PTS flag even if no PTS stored
arpi
parents: 7124
diff changeset
157 // if ( (ioctl(vo_mpegpes_fd2,AUDIO_SET_MUTE, false) < 0)){
e6b46875e1b9 - fixed a 10l bug: setting PTS flag even if no PTS stored
arpi
parents: 7124
diff changeset
158 if ( (ioctl(vo_mpegpes_fd2,AUDIO_SET_MUTE, true) < 0)){
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
159 perror("DVB AUDIO SET MUTE: ");
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
160 return -1;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
161 }
7672
e6b46875e1b9 - fixed a 10l bug: setting PTS flag even if no PTS stored
arpi
parents: 7124
diff changeset
162 return 0;
e6b46875e1b9 - fixed a 10l bug: setting PTS flag even if no PTS stored
arpi
parents: 7124
diff changeset
163 }
e6b46875e1b9 - fixed a 10l bug: setting PTS flag even if no PTS stored
arpi
parents: 7124
diff changeset
164 #endif
e6b46875e1b9 - fixed a 10l bug: setting PTS flag even if no PTS stored
arpi
parents: 7124
diff changeset
165 vo_mpegpes_fd=open(arg ? arg : "grab.mpg",O_WRONLY|O_CREAT,0666);
1872
2fe0e11bab3c file writer implemented
arpi
parents: 1871
diff changeset
166 if(vo_mpegpes_fd<0){
2fe0e11bab3c file writer implemented
arpi
parents: 1871
diff changeset
167 perror("vo_mpegpes");
2fe0e11bab3c file writer implemented
arpi
parents: 1871
diff changeset
168 return -1;
2fe0e11bab3c file writer implemented
arpi
parents: 1871
diff changeset
169 }
7672
e6b46875e1b9 - fixed a 10l bug: setting PTS flag even if no PTS stored
arpi
parents: 7124
diff changeset
170 vo_mpegpes_fd2=vo_mpegpes_fd;
1871
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
171 return 0;
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
172 }
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
173
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
174
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
175 static void draw_osd(void)
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
176 {
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
177 }
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
178
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
179
1872
2fe0e11bab3c file writer implemented
arpi
parents: 1871
diff changeset
180 static void my_write(unsigned char* data,int len){
2066
2b14cad013b7 using poll() only for DVB card - not required for file write
arpi
parents: 1986
diff changeset
181 #ifdef HAVE_DVB
2b14cad013b7 using poll() only for DVB card - not required for file write
arpi
parents: 1986
diff changeset
182 #define NFD 2
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
183 struct pollfd pfd[NFD];
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
184
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
185 // printf("write %d bytes \n",len);
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
186
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
187 pfd[0].fd = vo_mpegpes_fd;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
188 pfd[0].events = POLLOUT;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
189
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
190 pfd[1].fd = vo_mpegpes_fd2;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
191 pfd[1].events = POLLOUT;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
192
1872
2fe0e11bab3c file writer implemented
arpi
parents: 1871
diff changeset
193 while(len>0){
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
194 if (poll(pfd,NFD,1)){
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
195 if (pfd[0].revents & POLLOUT){
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
196 int ret=write(vo_mpegpes_fd,data,len);
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
197 // printf("ret=%d \n",ret);
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
198 if(ret<=0){
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
199 perror("write");
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
200 usleep(0);
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
201 } else {
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
202 len-=ret; data+=ret;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
203 }
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
204 } else usleep(1000);
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
205 }
1872
2fe0e11bab3c file writer implemented
arpi
parents: 1871
diff changeset
206 }
2066
2b14cad013b7 using poll() only for DVB card - not required for file write
arpi
parents: 1986
diff changeset
207
2b14cad013b7 using poll() only for DVB card - not required for file write
arpi
parents: 1986
diff changeset
208 #else
2b14cad013b7 using poll() only for DVB card - not required for file write
arpi
parents: 1986
diff changeset
209 write(vo_mpegpes_fd,data,len); // write to file
2b14cad013b7 using poll() only for DVB card - not required for file write
arpi
parents: 1986
diff changeset
210 #endif
1872
2fe0e11bab3c file writer implemented
arpi
parents: 1871
diff changeset
211 }
1871
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
212
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
213 static unsigned char pes_header[PES_MAX_SIZE];
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
214
2706
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
215 void send_pes_packet(unsigned char* data,int len,int id,int timestamp){
4306
f11e25b77c1e cleanup of video packet writer, PTS sent only once
arpi
parents: 4299
diff changeset
216 int ptslen=timestamp?5:1;
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
217
4306
f11e25b77c1e cleanup of video packet writer, PTS sent only once
arpi
parents: 4299
diff changeset
218 // startcode:
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
219 pes_header[0]=pes_header[1]=0;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
220 pes_header[2]=id>>8; pes_header[3]=id&255;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
221
4306
f11e25b77c1e cleanup of video packet writer, PTS sent only once
arpi
parents: 4299
diff changeset
222 while(len>0){
f11e25b77c1e cleanup of video packet writer, PTS sent only once
arpi
parents: 4299
diff changeset
223 int payload_size=len; // data + PTS
f11e25b77c1e cleanup of video packet writer, PTS sent only once
arpi
parents: 4299
diff changeset
224 if(6+ptslen+payload_size>PES_MAX_SIZE) payload_size=PES_MAX_SIZE-(6+ptslen);
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
225
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
226 // construct PES header: (code from ffmpeg's libav)
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
227 // packetsize:
4306
f11e25b77c1e cleanup of video packet writer, PTS sent only once
arpi
parents: 4299
diff changeset
228 pes_header[4]=(ptslen+payload_size)>>8;
f11e25b77c1e cleanup of video packet writer, PTS sent only once
arpi
parents: 4299
diff changeset
229 pes_header[5]=(ptslen+payload_size)&255;
f11e25b77c1e cleanup of video packet writer, PTS sent only once
arpi
parents: 4299
diff changeset
230
f11e25b77c1e cleanup of video packet writer, PTS sent only once
arpi
parents: 4299
diff changeset
231 if(ptslen==5){
f11e25b77c1e cleanup of video packet writer, PTS sent only once
arpi
parents: 4299
diff changeset
232 int x;
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
233 // presentation time stamp:
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
234 x=(0x02 << 4) | (((timestamp >> 30) & 0x07) << 1) | 1;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
235 pes_header[6]=x;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
236 x=((((timestamp >> 15) & 0x7fff) << 1) | 1);
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
237 pes_header[7]=x>>8; pes_header[8]=x&255;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
238 x=((((timestamp) & 0x7fff) << 1) | 1);
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
239 pes_header[9]=x>>8; pes_header[10]=x&255;
4306
f11e25b77c1e cleanup of video packet writer, PTS sent only once
arpi
parents: 4299
diff changeset
240 } else {
f11e25b77c1e cleanup of video packet writer, PTS sent only once
arpi
parents: 4299
diff changeset
241 // stuffing and header bits:
f11e25b77c1e cleanup of video packet writer, PTS sent only once
arpi
parents: 4299
diff changeset
242 pes_header[6]=0x0f;
f11e25b77c1e cleanup of video packet writer, PTS sent only once
arpi
parents: 4299
diff changeset
243 }
f11e25b77c1e cleanup of video packet writer, PTS sent only once
arpi
parents: 4299
diff changeset
244
f11e25b77c1e cleanup of video packet writer, PTS sent only once
arpi
parents: 4299
diff changeset
245 memcpy(&pes_header[6+ptslen],data,payload_size);
f11e25b77c1e cleanup of video packet writer, PTS sent only once
arpi
parents: 4299
diff changeset
246 my_write(pes_header,6+ptslen+payload_size);
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
247
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
248 len-=payload_size; data+=payload_size;
4306
f11e25b77c1e cleanup of video packet writer, PTS sent only once
arpi
parents: 4299
diff changeset
249 ptslen=1; // store PTS only once, at first packet!
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
250 }
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
251
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
252 // printf("PES: draw frame! pts=%d size=%d \n",timestamp,len);
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
253
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
254 }
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
255
4299
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
256 void send_lpcm_packet(unsigned char* data,int len,int id,unsigned int timestamp,int freq_id){
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
257
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
258 int ptslen=timestamp?5:0;
2706
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
259
4306
f11e25b77c1e cleanup of video packet writer, PTS sent only once
arpi
parents: 4299
diff changeset
260 // startcode:
2706
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
261 pes_header[0]=pes_header[1]=0;
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
262 pes_header[2]=1; pes_header[3]=0xBD;
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
263
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
264 while(len>=4){
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
265 int payload_size;
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
266
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
267 payload_size=PES_MAX_SIZE-6-20; // max possible data len
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
268 if(payload_size>len) payload_size=len;
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
269 payload_size&=(~3); // align!
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
270
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
271 //if(6+payload_size>PES_MAX_SIZE) payload_size=PES_MAX_SIZE-6;
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
272
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
273 // packetsize:
4299
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
274 pes_header[4]=(payload_size+3+ptslen+7)>>8;
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
275 pes_header[5]=(payload_size+3+ptslen+7)&255;
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
276
2706
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
277 // stuffing:
7672
e6b46875e1b9 - fixed a 10l bug: setting PTS flag even if no PTS stored
arpi
parents: 7124
diff changeset
278 // TTCCxxxx CC=css TT=type: 1=STD 0=mpeg1 2=vob
2706
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
279 pes_header[6]=0x81;
7672
e6b46875e1b9 - fixed a 10l bug: setting PTS flag even if no PTS stored
arpi
parents: 7124
diff changeset
280
e6b46875e1b9 - fixed a 10l bug: setting PTS flag even if no PTS stored
arpi
parents: 7124
diff changeset
281 // FFxxxxxx FF=pts flags=2 vs 0
e6b46875e1b9 - fixed a 10l bug: setting PTS flag even if no PTS stored
arpi
parents: 7124
diff changeset
282 pes_header[7]=ptslen ? 0x80 : 0;
4299
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
283
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
284 // hdrlen:
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
285 pes_header[8]=ptslen;
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
286
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
287 if(ptslen){
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
288 int x;
2706
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
289 // presentation time stamp:
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
290 x=(0x02 << 4) | (((timestamp >> 30) & 0x07) << 1) | 1;
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
291 pes_header[9]=x;
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
292 x=((((timestamp >> 15) & 0x7fff) << 1) | 1);
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
293 pes_header[10]=x>>8; pes_header[11]=x&255;
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
294 x=((((timestamp) & 0x7fff) << 1) | 1);
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
295 pes_header[12]=x>>8; pes_header[13]=x&255;
4299
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
296 }
2706
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
297
4299
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
298 // ============ LPCM header: (7 bytes) =================
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
299 // Info by mocm@convergence.de
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
300
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
301 // ID:
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
302 pes_header[ptslen+9]=id;
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
303
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
304 // number of frames:
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
305 pes_header[ptslen+10]=0x07;
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
306
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
307 // first acces unit pointer, i.e. start of audio frame:
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
308 pes_header[ptslen+11]=0x00;
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
309 pes_header[ptslen+12]=0x04;
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
310
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
311 // audio emphasis on-off 1 bit
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
312 // audio mute on-off 1 bit
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
313 // reserved 1 bit
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
314 // audio frame number 5 bit
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
315 pes_header[ptslen+13]=0x0C;
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
316
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
317 // quantization word length 2 bit
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
318 // audio sampling frequency (48khz = 0, 96khz = 1) 2 bit
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
319 // reserved 1 bit
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
320 // number of audio channels - 1 (e.g. stereo = 1) 3 bit
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
321 pes_header[ptslen+14]=1|(freq_id<<4);
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
322
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
323 // dynamic range control (0x80 if off)
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
324 pes_header[ptslen+15]=0x80;
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
325
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
326 memcpy(&pes_header[6+3+ptslen+7],data,payload_size);
8e157167cee5 LPCM write code rewritten, thanks to Marcus at mocm@convergence.de
arpi
parents: 2727
diff changeset
327 my_write(pes_header,6+3+ptslen+7+payload_size);
2706
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
328
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
329 len-=payload_size; data+=payload_size;
4306
f11e25b77c1e cleanup of video packet writer, PTS sent only once
arpi
parents: 4299
diff changeset
330 ptslen=0; // store PTS only once, at first packet!
2706
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
331 }
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
332
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
333 // printf("PES: draw frame! pts=%d size=%d \n",timestamp,len);
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
334
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
335 }
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
336
3066369adb32 audio packet writting added
arpi
parents: 2496
diff changeset
337
1871
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
338 static uint32_t draw_frame(uint8_t * src[])
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
339 {
1872
2fe0e11bab3c file writer implemented
arpi
parents: 1871
diff changeset
340 vo_mpegpes_t *p=(vo_mpegpes_t *)src[0];
5877
93de400ad48e libfame code removed (use -vop fame/-vop lavc), init code moved to preinit, height checks added to config()
arpi
parents: 5844
diff changeset
341 send_pes_packet(p->data,p->size,p->id,(p->timestamp>0)?p->timestamp:vo_pts); // video data
1871
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
342 return 0;
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
343 }
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
344
1935
fcd39f3b13d4 YV12 support (using libavcodec for mpeg1-I encoding)
arpi
parents: 1876
diff changeset
345 static void flip_page (void)
fcd39f3b13d4 YV12 support (using libavcodec for mpeg1-I encoding)
arpi
parents: 1876
diff changeset
346 {
fcd39f3b13d4 YV12 support (using libavcodec for mpeg1-I encoding)
arpi
parents: 1876
diff changeset
347 }
fcd39f3b13d4 YV12 support (using libavcodec for mpeg1-I encoding)
arpi
parents: 1876
diff changeset
348
fcd39f3b13d4 YV12 support (using libavcodec for mpeg1-I encoding)
arpi
parents: 1876
diff changeset
349 static uint32_t draw_slice(uint8_t *srcimg[], int stride[], int w,int h,int x0,int y0)
fcd39f3b13d4 YV12 support (using libavcodec for mpeg1-I encoding)
arpi
parents: 1876
diff changeset
350 {
fcd39f3b13d4 YV12 support (using libavcodec for mpeg1-I encoding)
arpi
parents: 1876
diff changeset
351 return 0;
fcd39f3b13d4 YV12 support (using libavcodec for mpeg1-I encoding)
arpi
parents: 1876
diff changeset
352 }
fcd39f3b13d4 YV12 support (using libavcodec for mpeg1-I encoding)
arpi
parents: 1876
diff changeset
353
fcd39f3b13d4 YV12 support (using libavcodec for mpeg1-I encoding)
arpi
parents: 1876
diff changeset
354
1871
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
355 static uint32_t
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
356 query_format(uint32_t format)
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
357 {
5566
e01c664def74 VFCAP added
arpi
parents: 5560
diff changeset
358 if(format==IMGFMT_MPEGPES) return 3|VFCAP_TIMER;
1871
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
359 return 0;
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
360 }
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
361
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
362 static void
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
363 uninit(void)
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
364 {
7672
e6b46875e1b9 - fixed a 10l bug: setting PTS flag even if no PTS stored
arpi
parents: 7124
diff changeset
365 if(vo_mpegpes_fd2>=0 && vo_mpegpes_fd2!=vo_mpegpes_fd) close(vo_mpegpes_fd2);
e6b46875e1b9 - fixed a 10l bug: setting PTS flag even if no PTS stored
arpi
parents: 7124
diff changeset
366 vo_mpegpes_fd2=-1;
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
367 if(vo_mpegpes_fd>=0){ close(vo_mpegpes_fd);vo_mpegpes_fd=-1;}
1871
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
368 }
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
369
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
370
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
371 static void check_events(void)
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
372 {
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
373 }
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
374
4596
c35d7ce151b3 10000hl to Holm... control MUST BE static...
arpi
parents: 4592
diff changeset
375 static uint32_t control(uint32_t request, void *data, ...)
4352
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4341
diff changeset
376 {
4592
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4433
diff changeset
377 switch (request) {
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4433
diff changeset
378 case VOCTRL_QUERY_FORMAT:
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4433
diff changeset
379 return query_format(*((uint32_t*)data));
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4433
diff changeset
380 }
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4433
diff changeset
381 return VO_NOTIMPL;
4352
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4341
diff changeset
382 }