2
generic interactive controler
3
Copyright (C) 1998 Martin Vogt
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU Library General Public License as published by
7
the Free Software Foundation.
9
For more information look at the file COPYRIGHT in this package
16
// Set for local include
17
#define DIRECT_INCLUDE
19
#include "../yafcore/yaf_control.h"
20
#include "../yafxplayer/inputDecoderYAF.h"
30
#if defined(HAVE_GETOPT_H)
34
// we include our plugin here
35
#include "../../../lib/decoder/mpgPlugin.h"
37
#if defined(HAVE_GETOPT_H)
45
void control_mpgplay(InputInterface* input,OutputInterface* output,
46
InputDecoder* decoder) {
49
cout<< "Command:0 Msg:protocol yaf-0.1" << endl;
50
cout<< "Command:0 Msg:implements xplayer" << endl;
51
cout<< "Command:0 Msg:decoder splay Version:0.8.2" << endl;
52
cout<< "Command:0 Msg:decoder mpeg_play Version:2.4.0" << endl;
53
cout<< "Command:0 Msg:mimetypes video/mpeg;" << endl;
54
cout<< "Command:0 Msg:comment splay by Woo-jae Jung" << endl;
55
cout<< "Command:0 Msg:comment mpeg_play by University of California" << endl;
56
cout<< "Command:0 Msg:comment yaf port by mvogt@rhrk.uni-kl.de"<<endl;
57
cout<< "Command:0 Msg:comment based on sources from mpeg_play and splay"<<endl;
58
cout<< "Command:0 Msg:comment enter 'help' " << endl;
64
yaf_control(input,output,decoder);
69
cout << "yaf-mpgplay is a interactive frontend for the mpeg I decoder"<<endl;
70
cout << "Usage : yaf-mpgplay [2al:L:scb:mhpywd:] [url]"<<endl;
72
cout << "-2 : playing with half frequency."<<endl;
73
cout << "-m : force to mono."<<endl;
74
cout << "-a : no internal audio device"<<endl;
75
cout << "-c : no time calculation"<<endl;
76
cout << "-s : no audio/video sync"<<endl;
77
cout << "-b : audio buffer delay (bytes)[65535 byte]"<<endl;
78
cout << "-p : measure performance (audio is decoded, but not played)"<<endl;
79
cout << "-l : select audio Layer [0]"<<endl;
80
cout << "-L : select video Layer [0]"<<endl;
81
cout << "-w : write streams to disk [demultiplex]"<<endl;
82
cout << "-y : autoplay off"<<endl;
83
cout << "-d : [1..2] dump yuv images 1: single images 2: as stream"<<endl;
85
cout << "THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! " \
86
<< "USE AT YOUR OWN RISK!"<<endl;
88
cout << "for more help type 'help' in interactive mode"<<endl;
94
int main(int argc, char** argv) {
96
int lInternalAudio=true;
98
pow(6.0,3.0); // fixes bug in __math.h
100
OutputInterface output(&cout);
106
YafOutputStream* yafOutput=new YafOutputStream(&input);
107
MpgPlugin* plugin=new MpgPlugin();
109
plugin->setOutputPlugin(yafOutput);
110
InputDecoderYAF decoder(plugin,yafOutput);
115
c = getopt (argc, argv, "2al:L:scb:mhpywd:");
119
lInternalAudio=false;
127
decoder.setAutoPlay(false);
131
plugin->config("-2","true",NULL);
135
plugin->config("-m","true",NULL);
139
plugin->config("-c","true",NULL);
143
plugin->config("-w","true",NULL);
147
yafOutput->config("-s","true",NULL);
151
yafOutput->config("-b",optarg,NULL);
155
yafOutput->config("yufDump",optarg,NULL);
159
yafOutput->config("-p",optarg,NULL);
163
plugin->config("AudioLayer",optarg,NULL);
164
cout << "trying to configure" << endl;
168
plugin->config("VideoLayer",optarg,NULL);
174
printf ("?? getopt returned character code 0%o ??\n", c);
180
if (optind < argc ) {
182
buffer.append("open ");
183
buffer.append(argv[optind]);
185
input.addInputLine(&buffer);
188
yafOutput->internalDevice(lInternalAudio);
189
control_mpgplay(&input,&output,&decoder);