mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 15:02:58 +02:00
raspi: add support for MPEG2
TODO: check if the MPEG2 license is present (and warn if not)
This commit is contained in:
@@ -60,6 +60,7 @@ static AVRational omx_timebase = {1,1000000};
|
||||
|
||||
static struct codecs_t codecs;
|
||||
static struct omx_pipeline_t omxpipe;
|
||||
static OMX_VIDEO_CODINGTYPE vcodectype;
|
||||
|
||||
extern cDemux *audioDemux;
|
||||
extern cDemux *videoDemux;
|
||||
@@ -269,6 +270,22 @@ int AVDec::pig(int x, int y, int w, int h)
|
||||
return -1;
|
||||
}
|
||||
|
||||
int AVDec::set_videoformat(int format)
|
||||
{
|
||||
lt_info("AVDec::set_videoformat(%d)\n", format);
|
||||
switch (format) {
|
||||
case 0:
|
||||
vcodectype = OMX_VIDEO_CodingMPEG2;
|
||||
break;
|
||||
case 1:
|
||||
vcodectype = OMX_VIDEO_CodingAVC;
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
Dec *d;
|
||||
bool audio;
|
||||
@@ -463,6 +480,7 @@ void vDec::run()
|
||||
hal_set_threadname("hal:vdec");
|
||||
lt_info("====================== start video decoder thread ================================\n");
|
||||
int ret = 0;
|
||||
codecs.vcodec.vcodectype = vcodectype;
|
||||
codec_new_channel(&codecs.vcodec);
|
||||
codecs.vcodec.first_packet = 1;
|
||||
codecs.vcodec.is_running = 1;
|
||||
|
@@ -32,4 +32,5 @@ public:
|
||||
int show_picture(const char *filename);
|
||||
int set_aspect(int aspect, int mode);
|
||||
int pig(int x, int y, int w, int h);
|
||||
int set_videoformat(int format);
|
||||
};
|
||||
|
@@ -175,7 +175,7 @@ void cVideo::SetSyncMode(AVSYNC_TYPE)
|
||||
int cVideo::SetStreamType(VIDEO_FORMAT v)
|
||||
{
|
||||
v_format = v;
|
||||
return 0;
|
||||
return avdec->set_videoformat(v);
|
||||
}
|
||||
|
||||
bool cVideo::GetScreenImage(unsigned char * &data, int &xres, int &yres, bool get_video, bool get_osd, bool scale_to_video)
|
||||
|
Reference in New Issue
Block a user