1 | #ifndef PLAYER_H |
---|
2 | #define PLAYER_H |
---|
3 | |
---|
4 | #ifdef EPLAYER3 |
---|
5 | Context_t * player = NULL; |
---|
6 | extern OutputHandler_t OutputHandler; |
---|
7 | extern PlaybackHandler_t PlaybackHandler; |
---|
8 | extern ContainerHandler_t ContainerHandler; |
---|
9 | extern ManagerHandler_t ManagerHandler; |
---|
10 | #endif |
---|
11 | |
---|
12 | #ifdef EPLAYER4 |
---|
13 | GstElement *m_gst_playbin; |
---|
14 | #endif |
---|
15 | |
---|
16 | //titan player |
---|
17 | |
---|
18 | //flag 0: from play |
---|
19 | //flag 1: from timeshift |
---|
20 | int playerstartts(char* file, int flag) |
---|
21 | { |
---|
22 | int fd = -1, ret = 0; |
---|
23 | int16_t pmtpid = 0; |
---|
24 | int serviceid = 0; |
---|
25 | struct channel* chnode = NULL; |
---|
26 | struct service* snode = NULL; |
---|
27 | struct dvbdev* fenode = NULL; |
---|
28 | struct dvbdev* dvrnode = NULL; |
---|
29 | |
---|
30 | fd = open(file, O_RDONLY | O_LARGEFILE); |
---|
31 | if(fd < 0) |
---|
32 | { |
---|
33 | perr("open player file"); |
---|
34 | return 1; |
---|
35 | } |
---|
36 | |
---|
37 | fenode = fegetdummy(); |
---|
38 | dvrnode = dvropen(fenode); |
---|
39 | if(dvrnode == NULL) |
---|
40 | { |
---|
41 | err("find dvr dev"); |
---|
42 | close(fd); |
---|
43 | return 1; |
---|
44 | } |
---|
45 | |
---|
46 | if(flag == 0) |
---|
47 | { |
---|
48 | ret = dvbfindpmtpid(fd, &pmtpid, &serviceid); |
---|
49 | if(ret == 1) |
---|
50 | { |
---|
51 | err("find sid/pmt pid"); |
---|
52 | close(fd); |
---|
53 | dvrclose(dvrnode, -1); |
---|
54 | return 1; |
---|
55 | } |
---|
56 | chnode->pmtpid = pmtpid; |
---|
57 | chnode = createchannel("player", 0, 0, serviceid, 99, 0, -1, -1, -1, -1, 0); |
---|
58 | } |
---|
59 | else |
---|
60 | chnode = status.aktservice->channel; |
---|
61 | |
---|
62 | if(chnode == NULL) |
---|
63 | { |
---|
64 | err("create channel"); |
---|
65 | close(fd); |
---|
66 | dvrclose(dvrnode, -1); |
---|
67 | return 1; |
---|
68 | } |
---|
69 | |
---|
70 | if(flag == 1) |
---|
71 | { |
---|
72 | ret = servicestart(chnode, NULL, NULL, 2); |
---|
73 | if(ret != 0) |
---|
74 | { |
---|
75 | err("start play"); |
---|
76 | close(fd); |
---|
77 | dvrclose(dvrnode, -1); |
---|
78 | return 1; |
---|
79 | } |
---|
80 | } |
---|
81 | |
---|
82 | ret = recordstart(NULL, fd, dvrnode->fd, RECPLAY, 0, NULL); |
---|
83 | if(ret != 0) |
---|
84 | { |
---|
85 | err("start play thread"); |
---|
86 | close(fd); |
---|
87 | dvrclose(dvrnode, -1); |
---|
88 | return 1; |
---|
89 | } |
---|
90 | |
---|
91 | if(flag == 0) |
---|
92 | { |
---|
93 | ret = servicestart(chnode, NULL, NULL, 1); |
---|
94 | if(ret != 0) |
---|
95 | { |
---|
96 | err("start play"); |
---|
97 | snode = getservice(RECORDPLAY, 0); |
---|
98 | if(snode != NULL) snode->recendtime = 1; |
---|
99 | close(fd); |
---|
100 | dvrclose(dvrnode, -1); |
---|
101 | return 1; |
---|
102 | } |
---|
103 | } |
---|
104 | |
---|
105 | return 0; |
---|
106 | } |
---|
107 | |
---|
108 | //flag 0: from play |
---|
109 | //flag 1: from timeshift |
---|
110 | //flag1 0: stop from rcstop |
---|
111 | //flag1 1: stop from servicestop |
---|
112 | void playerstopts(int flag, int flag1) |
---|
113 | { |
---|
114 | int ret = 0; |
---|
115 | struct service* snode = NULL; |
---|
116 | |
---|
117 | snode = getservice(RECORDPLAY, flag1); |
---|
118 | if(snode != NULL) snode->recendtime = 1; |
---|
119 | |
---|
120 | if(flag == 0) |
---|
121 | { |
---|
122 | ret = servicestop(status.aktservice, 1, 1); |
---|
123 | if(ret == 1) |
---|
124 | { |
---|
125 | debug(150, "can't stop ts playback service"); |
---|
126 | } |
---|
127 | } |
---|
128 | } |
---|
129 | |
---|
130 | void playercontinuets() |
---|
131 | { |
---|
132 | videocontinue(status.aktservice->videodev); |
---|
133 | audioplay(status.aktservice->audiodev); |
---|
134 | } |
---|
135 | |
---|
136 | void playerpausets() |
---|
137 | { |
---|
138 | videofreeze(status.aktservice->videodev); |
---|
139 | audiopause(status.aktservice->audiodev); |
---|
140 | } |
---|
141 | |
---|
142 | //extern player |
---|
143 | |
---|
144 | int playerstart(char* file) |
---|
145 | { |
---|
146 | if(file != NULL) |
---|
147 | { |
---|
148 | #ifdef EPLAYER3 |
---|
149 | //use eplayer |
---|
150 | char * tmpfile = NULL; |
---|
151 | |
---|
152 | if(player != NULL) |
---|
153 | { |
---|
154 | debug(150, "eplayer allready running"); |
---|
155 | playerstop(); |
---|
156 | } |
---|
157 | |
---|
158 | player = malloc(sizeof(Context_t)); |
---|
159 | |
---|
160 | if(player == NULL) |
---|
161 | { |
---|
162 | err("no mem"); |
---|
163 | return 1; |
---|
164 | } |
---|
165 | |
---|
166 | if(strstr(file, "://") == NULL) |
---|
167 | tmpfile = ostrcat("file://", file, 0, 0); |
---|
168 | else |
---|
169 | tmpfile = ostrcat(file, "", 0, 0); |
---|
170 | |
---|
171 | if(tmpfile == NULL) |
---|
172 | { |
---|
173 | err("no mem"); |
---|
174 | free(player); player = NULL; |
---|
175 | return 1; |
---|
176 | } |
---|
177 | |
---|
178 | player->playback = &PlaybackHandler; |
---|
179 | player->output = &OutputHandler; |
---|
180 | player->container = &ContainerHandler; |
---|
181 | player->manager = &ManagerHandler; |
---|
182 | |
---|
183 | debug(150, "eplayername = %s", player->output->Name); |
---|
184 | |
---|
185 | //Registrating output devices |
---|
186 | player->output->Command(player, OUTPUT_ADD, "audio"); |
---|
187 | player->output->Command(player, OUTPUT_ADD, "video"); |
---|
188 | player->output->Command(player, OUTPUT_ADD, "subtitle"); |
---|
189 | |
---|
190 | if(player->playback->Command(player, PLAYBACK_OPEN, tmpfile) < 0) |
---|
191 | { |
---|
192 | free(player); player = NULL; |
---|
193 | free(tmpfile); |
---|
194 | return 1; |
---|
195 | } |
---|
196 | |
---|
197 | player->output->Command(player, OUTPUT_OPEN, NULL); |
---|
198 | player->playback->Command(player, PLAYBACK_PLAY, NULL); |
---|
199 | |
---|
200 | free(tmpfile); |
---|
201 | |
---|
202 | return 0; |
---|
203 | #endif |
---|
204 | |
---|
205 | #ifdef EPLAYER4 |
---|
206 | int flags = 0x47; //(GST_PLAY_FLAG_VIDEO | GST_PLAY_FLAG_AUDIO | GST_PLAY_FLAG_NATIVE_VIDEO | GST_PLAY_FLAG_TEXT); |
---|
207 | gchar *uri; |
---|
208 | |
---|
209 | if(m_gst_playbin != NULL) |
---|
210 | { |
---|
211 | debug(150, "eplayer allready running"); |
---|
212 | playerstop(); |
---|
213 | } |
---|
214 | |
---|
215 | uri = g_filename_to_uri(file, NULL, NULL); |
---|
216 | m_gst_playbin = gst_element_factory_make("playbin2", "playbin"); |
---|
217 | g_object_set(G_OBJECT (m_gst_playbin), "uri", uri, NULL); |
---|
218 | g_object_set(G_OBJECT (m_gst_playbin), "flags", flags, NULL); |
---|
219 | g_free(uri); |
---|
220 | |
---|
221 | return 0; |
---|
222 | #endif |
---|
223 | } |
---|
224 | |
---|
225 | return 1; |
---|
226 | } |
---|
227 | |
---|
228 | void playerinit(int argc, char* argv[]) |
---|
229 | { |
---|
230 | #ifdef EPLAYER4 |
---|
231 | gst_init(&argc, &argv); |
---|
232 | #endif |
---|
233 | } |
---|
234 | |
---|
235 | int playerisplaying() |
---|
236 | { |
---|
237 | #ifdef SIMULATE |
---|
238 | return 1; |
---|
239 | #endif |
---|
240 | |
---|
241 | #ifdef EPLAYER3 |
---|
242 | if(player != NULL && player->playback != NULL && player->playback->isPlaying) |
---|
243 | return 1; |
---|
244 | #endif |
---|
245 | |
---|
246 | return 0; |
---|
247 | } |
---|
248 | |
---|
249 | void playerplay() |
---|
250 | { |
---|
251 | #ifdef EPLAYER3 |
---|
252 | if(player && player->playback) |
---|
253 | player->playback->Command(player, PLAYBACK_PLAY, NULL); |
---|
254 | #endif |
---|
255 | } |
---|
256 | |
---|
257 | int playerstop() |
---|
258 | { |
---|
259 | #ifdef EPLAYER3 |
---|
260 | if(player && player->playback) |
---|
261 | player->playback->Command(player, PLAYBACK_STOP, NULL); |
---|
262 | if(player && player->container && player->container->selectedContainer) |
---|
263 | player->container->selectedContainer->Command(player, CONTAINER_STOP, NULL); |
---|
264 | if(player && player->output) |
---|
265 | { |
---|
266 | player->output->Command(player, OUTPUT_CLOSE, NULL); |
---|
267 | player->output->Command(player, OUTPUT_DEL, (void*)"audio"); |
---|
268 | player->output->Command(player, OUTPUT_DEL, (void*)"video"); |
---|
269 | player->output->Command(player, OUTPUT_DEL, (void*)"subtitle"); |
---|
270 | } |
---|
271 | if(player && player->playback) |
---|
272 | player->playback->Command(player, PLAYBACK_CLOSE, NULL); |
---|
273 | |
---|
274 | free(player); |
---|
275 | player = NULL; |
---|
276 | #endif |
---|
277 | |
---|
278 | #ifdef EPLAYER4 |
---|
279 | if(m_gst_playbin) |
---|
280 | { |
---|
281 | gst_element_set_state(m_gst_playbin, GST_STATE_NULL); |
---|
282 | gst_object_unref(GST_OBJECT(m_gst_playbin)) |
---|
283 | m_gst_playbin = 0; |
---|
284 | } |
---|
285 | #endif |
---|
286 | |
---|
287 | writesysint("/proc/sys/vm/drop_caches", 3, 0); |
---|
288 | return 0; |
---|
289 | } |
---|
290 | |
---|
291 | void playerafterend() |
---|
292 | { |
---|
293 | #ifdef EPLAYER3 |
---|
294 | if(player != NULL && player->playback != NULL) |
---|
295 | playerstop(); |
---|
296 | #endif |
---|
297 | } |
---|
298 | |
---|
299 | void playerpause() |
---|
300 | { |
---|
301 | #ifdef EPLAYER3 |
---|
302 | if(player && player->playback) |
---|
303 | player->playback->Command(player, PLAYBACK_PAUSE, NULL); |
---|
304 | #endif |
---|
305 | |
---|
306 | #ifdef EPLAYER4 |
---|
307 | if(m_gst_playbin) |
---|
308 | gst_element_set_state(m_gst_playbin, GST_STATE_PAUSED); |
---|
309 | #endif |
---|
310 | } |
---|
311 | |
---|
312 | void playercontinue() |
---|
313 | { |
---|
314 | #ifdef EPLAYER3 |
---|
315 | if(player && player->playback) |
---|
316 | player->playback->Command(player, PLAYBACK_CONTINUE, NULL); |
---|
317 | #endif |
---|
318 | |
---|
319 | #ifdef EPLAYER4 |
---|
320 | if(m_gst_playbin) |
---|
321 | gst_element_set_state(m_gst_playbin, GST_STATE_PLAYING); |
---|
322 | #endif |
---|
323 | } |
---|
324 | |
---|
325 | void playerff(int speed) |
---|
326 | { |
---|
327 | #ifdef EPLAYER3 |
---|
328 | int speedmap = 0; |
---|
329 | |
---|
330 | if (speed < 1) speed = 1; |
---|
331 | if (speed > 7) speed = 7; |
---|
332 | |
---|
333 | switch(speed) |
---|
334 | { |
---|
335 | case 1: speedmap = 1; break; |
---|
336 | case 2: speedmap = 3; break; |
---|
337 | case 3: speedmap = 7; break; |
---|
338 | case 4: speedmap = 15; break; |
---|
339 | case 5: speedmap = 31; break; |
---|
340 | case 6: speedmap = 63; break; |
---|
341 | case 7: speedmap = 127; break; |
---|
342 | } |
---|
343 | |
---|
344 | if(player && player->playback) |
---|
345 | player->playback->Command(player, PLAYBACK_FASTFORWARD, &speedmap); |
---|
346 | #endif |
---|
347 | } |
---|
348 | |
---|
349 | void playerfr(int speed) |
---|
350 | { |
---|
351 | #ifdef EPLAYER3 |
---|
352 | int speedmap = 0; |
---|
353 | |
---|
354 | if (speed > -1) speed = -1; |
---|
355 | if (speed < -7) speed = -7; |
---|
356 | |
---|
357 | switch(speed) |
---|
358 | { |
---|
359 | case -1: speedmap = -5; break; |
---|
360 | case -2: speedmap = -10; break; |
---|
361 | case -3: speedmap = -20; break; |
---|
362 | case -4: speedmap = -40; break; |
---|
363 | case -5: speedmap = -80; break; |
---|
364 | case -6: speedmap = -160; break; |
---|
365 | case -7: speedmap = -320; break; |
---|
366 | } |
---|
367 | |
---|
368 | if(player && player->playback) |
---|
369 | player->playback->Command(player, PLAYBACK_FASTBACKWARD, &speedmap); |
---|
370 | #endif |
---|
371 | } |
---|
372 | |
---|
373 | void playerseek(float sec) |
---|
374 | { |
---|
375 | #ifdef EPLAYER3 |
---|
376 | if(player && player->playback) |
---|
377 | player->playback->Command(player, PLAYBACK_SEEK, (void*)&sec); |
---|
378 | #endif |
---|
379 | |
---|
380 | #ifdef EPLAYER4 |
---|
381 | gint64 time_nanoseconds; |
---|
382 | gint64 pos; |
---|
383 | GstFormat fmt = GST_FORMAT_TIME; |
---|
384 | |
---|
385 | if(m_gst_playbin) |
---|
386 | { |
---|
387 | gst_element_query_position(m_gst_playbin, &fmt, &pos); |
---|
388 | time_nanoseconds = pos + (sec * 1000000000); |
---|
389 | if(time_nanoseconds < 0) time_nanoseconds = 0; |
---|
390 | gst_element_seek(m_gst_playbin, 1.0, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET, time_nanoseconds, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE); |
---|
391 | } |
---|
392 | #endif |
---|
393 | } |
---|
394 | |
---|
395 | void playerfreetracklist(char** TrackList) |
---|
396 | { |
---|
397 | int i = 0; |
---|
398 | |
---|
399 | if(TrackList != NULL) |
---|
400 | { |
---|
401 | while(TrackList[i] != NULL) |
---|
402 | { |
---|
403 | free(TrackList[i]); |
---|
404 | free(TrackList[i + 1]); |
---|
405 | i += 2; |
---|
406 | } |
---|
407 | } |
---|
408 | } |
---|
409 | |
---|
410 | char** playergettracklist(int type) |
---|
411 | { |
---|
412 | char ** TrackList = NULL; |
---|
413 | #ifdef EPLAYER3 |
---|
414 | if(player && player->manager) |
---|
415 | { |
---|
416 | switch(type) |
---|
417 | { |
---|
418 | case 1: |
---|
419 | if(player->manager->audio) |
---|
420 | { |
---|
421 | player->manager->audio->Command(player, MANAGER_LIST, &TrackList); |
---|
422 | debug(150, "Audio Track List"); |
---|
423 | } |
---|
424 | break; |
---|
425 | case 2: |
---|
426 | if(player->manager->subtitle) |
---|
427 | { |
---|
428 | player->manager->subtitle->Command(player, MANAGER_LIST, &TrackList); |
---|
429 | debug(150, "Subtitle Track List"); |
---|
430 | } |
---|
431 | break; |
---|
432 | default: |
---|
433 | if(player->manager->video) |
---|
434 | { |
---|
435 | player->manager->video->Command(player, MANAGER_LIST, &TrackList); |
---|
436 | debug(150, "Video Track List"); |
---|
437 | } |
---|
438 | } |
---|
439 | |
---|
440 | if(TrackList != NULL) |
---|
441 | { |
---|
442 | debug(150, "Track List"); |
---|
443 | int i = 0; |
---|
444 | while(TrackList[i] != NULL) |
---|
445 | { |
---|
446 | debug(150, "%s - %s", TrackList[i], TrackList[i + 1]); |
---|
447 | i += 2; |
---|
448 | } |
---|
449 | } |
---|
450 | } |
---|
451 | #endif |
---|
452 | return TrackList; |
---|
453 | } |
---|
454 | |
---|
455 | //*CurTrackEncoding and *CurTrackName be freed |
---|
456 | void playergetcurtrac(int type, int *CurTrackId, char** CurTrackEncoding, char** CurTrackName) |
---|
457 | { |
---|
458 | #ifdef EPLAYER3 |
---|
459 | if(player && player->manager) |
---|
460 | { |
---|
461 | switch(type) |
---|
462 | { |
---|
463 | case 1: |
---|
464 | if(player->manager->audio) |
---|
465 | { |
---|
466 | player->manager->audio->Command(player, MANAGER_GET, CurTrackId); |
---|
467 | player->manager->audio->Command(player, MANAGER_GETENCODING, CurTrackEncoding); |
---|
468 | player->manager->audio->Command(player, MANAGER_GETNAME, CurTrackName); |
---|
469 | } |
---|
470 | break; |
---|
471 | case 2: |
---|
472 | if(player->manager->subtitle) |
---|
473 | { |
---|
474 | player->manager->subtitle->Command(player, MANAGER_GET, CurTrackId); |
---|
475 | player->manager->subtitle->Command(player, MANAGER_GETENCODING, CurTrackEncoding); |
---|
476 | player->manager->subtitle->Command(player, MANAGER_GETNAME, CurTrackName); |
---|
477 | } |
---|
478 | break; |
---|
479 | default: |
---|
480 | if(player->manager->video) |
---|
481 | { |
---|
482 | player->manager->video->Command(player, MANAGER_GET, CurTrackId); |
---|
483 | player->manager->video->Command(player, MANAGER_GETENCODING, CurTrackEncoding); |
---|
484 | player->manager->video->Command(player, MANAGER_GETNAME, CurTrackName); |
---|
485 | } |
---|
486 | } |
---|
487 | |
---|
488 | if(CurTrackId != NULL) |
---|
489 | debug(150, "Current Track ID: %d", *CurTrackId); |
---|
490 | if(*CurTrackEncoding != NULL) |
---|
491 | debug(150, "Current Track Enc: %s", *CurTrackEncoding); |
---|
492 | if(*CurTrackName != NULL) |
---|
493 | debug(150, "Current Track Name: %s", *CurTrackName); |
---|
494 | } |
---|
495 | #endif |
---|
496 | |
---|
497 | #ifdef EPLAYER4 |
---|
498 | if(m_gst_playbin != NULL) |
---|
499 | { |
---|
500 | switch(type) |
---|
501 | { |
---|
502 | case 1: |
---|
503 | g_object_get(G_OBJECT(m_gst_playbin), "current-audio", CurTrackId, NULL); |
---|
504 | break; |
---|
505 | } |
---|
506 | |
---|
507 | if(CurTrackId != NULL) |
---|
508 | debug(150, "Current Track ID: %d", *CurTrackId); |
---|
509 | } |
---|
510 | #endif |
---|
511 | } |
---|
512 | |
---|
513 | unsigned long long int playergetpts() |
---|
514 | { |
---|
515 | unsigned long long int pts = 0; |
---|
516 | unsigned long long int sec = 0; |
---|
517 | |
---|
518 | #ifdef EPLAYER3 |
---|
519 | if(player && player->playback) |
---|
520 | { |
---|
521 | player->playback->Command(player, PLAYBACK_PTS, &pts); |
---|
522 | sec = pts / 90000; |
---|
523 | debug(150, "Pts = %02d:%02d:%02d (%llu.0000 sec)", (int)((sec / 60) / 60) % 60, (int)(sec / 60) % 60, (int)sec % 60, sec); |
---|
524 | } |
---|
525 | #endif |
---|
526 | |
---|
527 | #ifdef EPLAYER4 |
---|
528 | GstFormat fmt = GST_FORMAT_TIME; //Returns time in nanosecs |
---|
529 | |
---|
530 | if(m_gst_playbin) |
---|
531 | { |
---|
532 | gst_element_query_position(m_gst_playbin, &fmt, &pts); |
---|
533 | sec = pts / 1000000000.0; |
---|
534 | debug(150, "Pts = %02d:%02d:%02d (%llu.0000 sec)", (int)((sec / 60) / 60) % 60, (int)(sec / 60) % 60, (int)sec % 60, sec); |
---|
535 | } |
---|
536 | #endif |
---|
537 | |
---|
538 | return pts; |
---|
539 | } |
---|
540 | |
---|
541 | double playergetlength() |
---|
542 | { |
---|
543 | double length = 0; |
---|
544 | |
---|
545 | #ifdef EPLAYER3 |
---|
546 | if(player && player->playback) |
---|
547 | { |
---|
548 | player->playback->Command(player, PLAYBACK_LENGTH, &length); |
---|
549 | if(length < 0) length = 0; |
---|
550 | debug(150, "Length = %02d:%02d:%02d (%.4f sec)", (int)((length / 60) / 60) % 60, (int)(length / 60) % 60, (int)length % 60, length); |
---|
551 | } |
---|
552 | #endif |
---|
553 | |
---|
554 | #ifdef EPLAYER4 |
---|
555 | GstFormat fmt = GST_FORMAT_TIME; //Returns time in nanosecs |
---|
556 | gint64 len; |
---|
557 | |
---|
558 | if(m_gst_playbin) |
---|
559 | { |
---|
560 | gst_element_query_duration(m_gst_playbin, &fmt, &len); |
---|
561 | length = len / 1000000000.0; |
---|
562 | if(length < 0) length = 0; |
---|
563 | debug(150, "Length = %02d:%02d:%02d (%.4f sec)", (int)((length / 60) / 60) % 60, (int)(length / 60) % 60, (int)length % 60, length); |
---|
564 | } |
---|
565 | #endif |
---|
566 | |
---|
567 | return length; |
---|
568 | } |
---|
569 | |
---|
570 | //TODO: implement |
---|
571 | char* playergetinfo(char* tag) |
---|
572 | { |
---|
573 | char *ret = NULL; |
---|
574 | |
---|
575 | #ifdef EPLAYER3 |
---|
576 | //char *tags[] = {"Title", "Artist", "Album", "Year", "Genre", "Comment", "Track", "Copyright", "TestLibEplayer", NULL}; |
---|
577 | //int i = 0; |
---|
578 | |
---|
579 | if(player && player->playback) |
---|
580 | { |
---|
581 | // while(tags[i] != NULL) |
---|
582 | // { |
---|
583 | // char* tag = tags[i]; |
---|
584 | player->playback->Command(player, PLAYBACK_INFO, &ret); |
---|
585 | |
---|
586 | if(tag != NULL) |
---|
587 | printf("%s:%s",tag, ret); |
---|
588 | else |
---|
589 | printf("%s:NULL",tag); |
---|
590 | //i++; |
---|
591 | //} |
---|
592 | } |
---|
593 | #endif |
---|
594 | return ret; |
---|
595 | } |
---|
596 | |
---|
597 | void playerchangeaudiotrack(int num) |
---|
598 | { |
---|
599 | #ifdef EPLAYER3 |
---|
600 | if(player && player->playback) |
---|
601 | { |
---|
602 | if(num >= 0 && num <= 9) |
---|
603 | player->playback->Command(player, PLAYBACK_SWITCH_AUDIO, (void*)&num); |
---|
604 | } |
---|
605 | #endif |
---|
606 | |
---|
607 | #ifdef EPLAYER4 |
---|
608 | if(m_gst_playbin != NULL) |
---|
609 | g_object_set(G_OBJECT(m_gst_playbin), "current-audio", num, NULL); |
---|
610 | #endif |
---|
611 | } |
---|
612 | |
---|
613 | void playerchangesubtitletrack(int num) |
---|
614 | { |
---|
615 | #ifdef EPLAYER3 |
---|
616 | if(player && player->playback) |
---|
617 | { |
---|
618 | if(num >= 0 && num <= 9) |
---|
619 | player->playback->Command(player, PLAYBACK_SWITCH_SUBTITLE, (void*)&num); |
---|
620 | } |
---|
621 | #endif |
---|
622 | } |
---|
623 | |
---|
624 | #endif |
---|
625 | |
---|
626 | //TODO: implement |
---|
627 | /* |
---|
628 | SubtitleOutputDef_t out; |
---|
629 | |
---|
630 | out.screen_width = xRes; |
---|
631 | out.screen_height = yRes; |
---|
632 | out.framebufferFD = fd; |
---|
633 | out.destination = lfb; |
---|
634 | out.destStride = stride; |
---|
635 | out.shareFramebuffer = 1; |
---|
636 | |
---|
637 | player->output->subtitle->Command(player, (OutputCmd_t)OUTPUT_SET_SUBTITLE_OUTPUT, (void*) &out); |
---|
638 | */ |
---|