annotate libvo/vo_mpegpes.c @ 1913:717f46012fce

Radeon VE QZ support
author nick
date Tue, 18 Sep 2001 16:16:19 +0000
parents 220475b1676a
children fcd39f3b13d4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
1 //#define HAVE_DVB
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
2 #define PES_MAX_SIZE 2048
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
3 /*
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
4 * Based on:
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
5 *
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
6 * test_av.c - Test program for new API
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
7 *
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
8 * Copyright (C) 2000 Ralph Metzler <ralph@convergence.de>
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
9 * & Marcus Metzler <marcus@convergence.de>
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
10 * for convergence integrated media GmbH
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
11 *
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
12 * libav - MPEG-PS multiplexer, part of ffmpeg
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
13 * Copyright Gerard Lantau (see http://ffmpeg.sf.net)
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
14 *
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
15 */
1871
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
16
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
17 #include <stdio.h>
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
18 #include <stdlib.h>
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
19 #include <string.h>
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
20
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
21 #include <sys/types.h>
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
22 #include <sys/stat.h>
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
23 #include <fcntl.h>
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
24 #include <sys/poll.h>
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
25
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
26 #ifdef HAVE_DVB
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
27
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
28 #include <sys/ioctl.h>
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
29 #include <stdio.h>
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
30 #include <time.h>
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
31 #include <unistd.h>
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
32
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
33 #include <ost/dmx.h>
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
34 #include <ost/frontend.h>
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
35 #include <ost/sec.h>
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
36 #include <ost/video.h>
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
37 #include <ost/audio.h>
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
38
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
39 #endif
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
40
1871
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
41 #include "config.h"
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
42 #include "video_out.h"
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
43 #include "video_out_internal.h"
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
44
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
45 LIBVO_EXTERN (mpegpes)
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
46
1872
2fe0e11bab3c file writer implemented
arpi
parents: 1871
diff changeset
47 int vo_mpegpes_fd=-1;
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
48 int vo_mpegpes_fd2=-1;
1872
2fe0e11bab3c file writer implemented
arpi
parents: 1871
diff changeset
49
1871
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
50 static vo_info_t vo_info =
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
51 {
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
52 #ifdef HAVE_DVB
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
53 "Mpeg-PES to DVB card",
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
54 #else
1871
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
55 "Mpeg-PES file",
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
56 #endif
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
57 "mpegpes",
1871
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
58 "A'rpi",
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
59 ""
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
60 };
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
61
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
62 static uint32_t
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
63 init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format)
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
64 {
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
65 #ifdef HAVE_DVB
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
66 //|O_NONBLOCK
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
67 if((vo_mpegpes_fd = open("/dev/ost/video",O_RDWR)) < 0){
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
68 perror("DVB VIDEO DEVICE: ");
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
69 return -1;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
70 }
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
71 if((vo_mpegpes_fd2 = open("/dev/ost/audio",O_RDWR|O_NONBLOCK)) < 0){
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
72 perror("DVB AUDIO DEVICE: ");
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
73 return -1;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
74 }
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
75 if ( (ioctl(vo_mpegpes_fd,VIDEO_SET_BLANK, false) < 0)){
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
76 perror("DVB VIDEO SET BLANK: ");
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
77 return -1;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
78 }
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
79 if ( (ioctl(vo_mpegpes_fd,VIDEO_SELECT_SOURCE, VIDEO_SOURCE_MEMORY) < 0)){
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
80 perror("DVB VIDEO SELECT SOURCE: ");
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
81 return -1;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
82 }
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
83 #if 1
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
84 if ( (ioctl(vo_mpegpes_fd2,AUDIO_SELECT_SOURCE, AUDIO_SOURCE_MEMORY) < 0)){
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
85 perror("DVB AUDIO SELECT SOURCE: ");
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
86 return -1;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
87 }
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
88 if ( (ioctl(vo_mpegpes_fd2,AUDIO_PLAY) < 0)){
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
89 perror("DVB AUDIO PLAY: ");
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
90 return -1;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
91 }
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
92 #else
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
93 if ( (ioctl(vo_mpegpes_fd2,AUDIO_STOP,0) < 0)){
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
94 perror("DVB AUDIO STOP: ");
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
95 return -1;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
96 }
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
97 #endif
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
98 if ( (ioctl(vo_mpegpes_fd,VIDEO_PLAY) < 0)){
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
99 perror("DVB VIDEO PLAY: ");
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
100 return -1;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
101 }
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
102 if ( (ioctl(vo_mpegpes_fd2,AUDIO_SET_AV_SYNC, false) < 0)){
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
103 perror("DVB AUDIO SET AV SYNC: ");
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
104 return -1;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
105 }
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
106 if ( (ioctl(vo_mpegpes_fd2,AUDIO_SET_MUTE, false) < 0)){
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
107 perror("DVB AUDIO SET MUTE: ");
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
108 return -1;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
109 }
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
110
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
111 #else
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
112 vo_mpegpes_fd=open("grab.mpg",O_WRONLY|O_CREAT);
1872
2fe0e11bab3c file writer implemented
arpi
parents: 1871
diff changeset
113 if(vo_mpegpes_fd<0){
2fe0e11bab3c file writer implemented
arpi
parents: 1871
diff changeset
114 perror("vo_mpegpes");
2fe0e11bab3c file writer implemented
arpi
parents: 1871
diff changeset
115 return -1;
2fe0e11bab3c file writer implemented
arpi
parents: 1871
diff changeset
116 }
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
117 #endif
1871
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
118 return 0;
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
119 }
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
120
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
121 static const vo_info_t*
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
122 get_info(void)
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
123 {
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
124 return &vo_info;
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
125 }
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
126
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
127 static void draw_osd(void)
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
128 {
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
129 }
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
130
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
131 static void flip_page (void)
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
132 {
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
133 }
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
134
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
135 static uint32_t draw_slice(uint8_t *srcimg[], int stride[], int w,int h,int x,int y)
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
136 {
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
137 return 0;
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
138 }
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
139
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
140 #define NFD 2
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
141
1872
2fe0e11bab3c file writer implemented
arpi
parents: 1871
diff changeset
142 static void my_write(unsigned char* data,int len){
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
143 struct pollfd pfd[NFD];
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
144
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
145 // printf("write %d bytes \n",len);
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
146
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
147 pfd[0].fd = vo_mpegpes_fd;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
148 pfd[0].events = POLLOUT;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
149
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
150 pfd[1].fd = vo_mpegpes_fd2;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
151 pfd[1].events = POLLOUT;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
152
1872
2fe0e11bab3c file writer implemented
arpi
parents: 1871
diff changeset
153 while(len>0){
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
154 if (poll(pfd,NFD,1)){
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
155 if (pfd[0].revents & POLLOUT){
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
156 int ret=write(vo_mpegpes_fd,data,len);
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
157 // printf("ret=%d \n",ret);
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
158 if(ret<=0){
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
159 perror("write");
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
160 usleep(0);
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
161 } else {
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
162 len-=ret; data+=ret;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
163 }
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
164 } else usleep(1000);
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
165 }
1872
2fe0e11bab3c file writer implemented
arpi
parents: 1871
diff changeset
166 }
2fe0e11bab3c file writer implemented
arpi
parents: 1871
diff changeset
167 }
1871
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
168
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
169 static unsigned char pes_header[PES_MAX_SIZE];
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
170
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
171 static void send_pes_packet(unsigned char* data,int len,int id,int timestamp){
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
172 int x;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
173
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
174 pes_header[0]=pes_header[1]=0;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
175 pes_header[2]=id>>8; pes_header[3]=id&255;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
176
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
177 while(1){
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
178 int payload_size=len+5; // data + PTS
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
179 if(6+payload_size>PES_MAX_SIZE) payload_size=PES_MAX_SIZE-6;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
180
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
181 // construct PES header: (code from ffmpeg's libav)
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
182 // startcode:
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
183 // packetsize:
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
184 pes_header[4]=(payload_size)>>8;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
185 pes_header[5]=(payload_size)&255;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
186 // stuffing:
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
187 // presentation time stamp:
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
188 x=(0x02 << 4) | (((timestamp >> 30) & 0x07) << 1) | 1;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
189 pes_header[6]=x;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
190 x=((((timestamp >> 15) & 0x7fff) << 1) | 1);
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
191 pes_header[7]=x>>8; pes_header[8]=x&255;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
192 x=((((timestamp) & 0x7fff) << 1) | 1);
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
193 pes_header[9]=x>>8; pes_header[10]=x&255;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
194
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
195 payload_size-=5;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
196 memcpy(&pes_header[6+5],data,payload_size);
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
197 my_write(pes_header,6+5+payload_size);
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
198
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
199 len-=payload_size; data+=payload_size;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
200 if(len<=0) break;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
201 }
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
202
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
203 // printf("PES: draw frame! pts=%d size=%d \n",timestamp,len);
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
204
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
205 }
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
206
1871
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
207 static uint32_t draw_frame(uint8_t * src[])
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
208 {
1872
2fe0e11bab3c file writer implemented
arpi
parents: 1871
diff changeset
209 vo_mpegpes_t *p=(vo_mpegpes_t *)src[0];
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
210 unsigned char *data=p->data;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
211 // int tmp=-1;
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
212 send_pes_packet(p->data,p->size,p->id,p->timestamp); // video data
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
213 // send_pes_packet(&tmp,0,0x1C0,p->timestamp+30000); // fake audio data
1871
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
214
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
215 return 0;
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
216 }
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
217
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
218 static uint32_t
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
219 query_format(uint32_t format)
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
220 {
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
221 if(format==IMGFMT_MPEGPES) return 1;
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
222 return 0;
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
223 }
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
224
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
225 static void
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
226 uninit(void)
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
227 {
1876
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
228 if(vo_mpegpes_fd>=0){ close(vo_mpegpes_fd);vo_mpegpes_fd=-1;}
220475b1676a PS multiplexing fixed
arpi
parents: 1872
diff changeset
229 if(vo_mpegpes_fd2>=0){ close(vo_mpegpes_fd2);vo_mpegpes_fd2=-1;}
1871
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
230 }
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
231
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
232
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
233 static void check_events(void)
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
234 {
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
235 }
cb5dde69354b Mpeg PES added
arpi
parents:
diff changeset
236