ChannelList* chanList = new ChannelList();
bool h264support=Video::getInstance()->supportsh264();
+ bool mpeg2support=Video::getInstance()->supportsmpeg2();
while (!vresp->end())
{
chan->name = vresp->extractString();
chan->vstreamtype = vresp->extractULONG();
- if (chan->type == type && (chan->vstreamtype!=0x1b || h264support))
+ if (chan->type == type && ((chan->vstreamtype==0x1b && h264support)|| mpeg2support) )
{
chanList->push_back(chan);
logger->log("VDR", Log::DEBUG, "Have added a channel to list. %lu %lu %s", chan->number, chan->type, chan->name);
virtual int EnterIframePlayback() {return 1;}; // Must not be implemented
virtual bool supportsh264(){return false;};
+ virtual bool supportsmpeg2(){return true;};
virtual void seth264mode(bool ish264) {h264=ish264;};
virtual int getTeletextBufferFaktor(){return 1;};
UCHAR getFormat() { return format; }
UINT getScreenWidth() { return screenWidth; }
UINT getScreenHeight() { return screenHeight; }
- UCHAR getTVsize() { return tvsize; }
+ virtual UCHAR getTVsize() { return tvsize; }
lastreftimePTS = 0;
firstsynched = false;
cur_clock_time=0;
+ mpeg2_supported=false;
//cur_pts=0;
mode=NORMAL;
if (initted) return 0;
initted = 1;
+ int ret=vc_gencmd_send("codec_enabled MPG2");
+ if (ret!=0) {
+ Log::getInstance()->log("Video", Log::DEBUG, "vc_gencmd_send failed %x",ret);
+ } else {
+ char buffer[1024];
+ ret=vc_gencmd_read_response(buffer,sizeof(buffer));
+ if (ret!=0) {
+ Log::getInstance()->log("Video", Log::DEBUG, "vc_gencmd_read_response failed %x",ret);
+ } else {
+ if (STRCASECMP(buffer,"MPG2=enabled")==0) {
+ mpeg2_supported=true;
+ } else if (STRCASECMP(buffer,"MPG2=disabled")==0) {
+ mpeg2_supported=false;
+ } else {
+ Log::getInstance()->log("Video", Log::DEBUG, "Undefined mpg codec answer %s",buffer);
+ }
+ }
+ }
+
if (!setFormat(tformat)) { shutdown(); return 0; }
if (!setConnection(HDMI)) { shutdown(); return 0; }
if (!setAspectRatio(ASPECT4X3,12,11)) { shutdown(); return 0; }
if (!setSource()) { shutdown(); return 0; }
if (!attachFrameBuffer()) { shutdown(); return 0; }
- setTVsize(ASPECT4X3);
+ setTVsize(ASPECT16X9);
selectVideoMode(0);
return 1;
}
+UCHAR VideoOMX::getTVsize() {
+ /*if (hdmi)*/
+ return ASPECT16X9; // in order that aspect ratio changes are reported
+ //return tvsize;
+}
+
void VideoOMX::executePendingModeChanges()
{
if (pendingmodechange) {
int setAspectRatio(UCHAR aspectRatio, int tparx,int tpary); // This one does the pin 8 scart widescreen switching
int setMode(UCHAR mode);
int setTVsize(UCHAR size); // Is the TV a widescreen?
+ UCHAR getTVsize();
void executePendingModeChanges();
int setDefaultAspect();
virtual bool supportsh264(){return true;};
+ virtual bool supportsmpeg2(){return mpeg2_supported;};
int WriteOutTS(const unsigned char *bulibaver,int length, int type);
void WriteOutPATPMT();
bool signalon;
bool pendingmodechange;
bool hdmi;
+ bool mpeg2_supported;
int outputinterlaced;
boxstack->add(vi);
boxstack->update(vi);
- } else {
+ } else if (!ish264 && !Video::getInstance()->supportsmpeg2()) {
+ VInfo* vi = new VInfo();
+ vi->setSize(360, 200);
+ vi->createBuffer();
+ if (Video::getInstance()->getFormat() == Video::PAL)
+ vi->setPosition(190, 170);
+ else
+ vi->setPosition(180, 120);
+ vi->setOneLiner(tr("Mpeg2 video not supported"));
+ vi->setExitable();
+ vi->setBorderOn(1);
+ vi->setTitleBarColour(DrawStyle::DANGER);
+ vi->okButton();
+ vi->draw();
+ boxstack->add(vi);
+ boxstack->update(vi);
+
+ }else {
VVideoRec* vidrec = new VVideoRec(toPlay, ish264);
vidrec->draw();
boxstack->add(vidrec);