raspi: first try of aspect ratio setting

this needs more work / testing with 4:3 input material
This commit is contained in:
Stefan Seyfried
2013-10-21 00:29:01 +02:00
parent a78e983d5f
commit 0b1c4bcb9c
4 changed files with 35 additions and 3 deletions

View File

@@ -99,6 +99,7 @@ class vDec: public Dec, public OpenThreads::Thread
public:
vDec();
~vDec();
int set_aspect(int aspect, int mode);
int set_pig(int x, int y, int w, int h);
private:
void run();
@@ -254,6 +255,13 @@ int AVDec::set_volume(int vol)
return -1;
}
int AVDec::set_aspect(int aspect, int mode)
{
if (vdec)
return vdec->set_aspect(aspect, mode);
return -1;
}
int AVDec::pig(int x, int y, int w, int h)
{
if (vdec)
@@ -419,6 +427,26 @@ int aDec::set_volume(int vol)
return 0;
}
int vDec::set_aspect(int aspect, int mode)
{
/* 1 = 4:3, 3 = 16:9 */
switch (aspect)
{
case 1:
codec_send_message(&codecs.vcodec, MSG_SET_ASPECT_4_3, NULL);
break;
case 3:
codec_send_message(&codecs.vcodec, MSG_SET_ASPECT_16_9, NULL);
break;
case -1:
break;
default:
lt_info("vDec::set_aspect: invalid aspect(%d)\n", aspect);
break;
}
return 0;
}
int vDec::set_pig(int x, int y, int w, int h)
{
struct pig_params_t *pig = (pig_params_t *)malloc(sizeof(struct pig_params_t));