summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Roitzsch <mroi@users.sourceforge.net>2003-08-05 15:07:42 +0000
committerMichael Roitzsch <mroi@users.sourceforge.net>2003-08-05 15:07:42 +0000
commitf6bce01c57ef131738ad84a6e1ef717c2873e6bd (patch)
treeb85d02a92a0cfc72c307a0004967492d4e9dc7df
parenta0dbaea3368ba4c327e0ae08e2dcfe9e314966dd (diff)
downloadxine-lib-f6bce01c57ef131738ad84a6e1ef717c2873e6bd.tar.gz
xine-lib-f6bce01c57ef131738ad84a6e1ef717c2873e6bd.tar.bz2
- adapt dxr3 code to new float aspects, use separate pan&scan flagging to
handle pan&scan information independently from the aspect - proper DVD button group handling in dxr3 spu decoder CVS patchset: 5248 CVS date: 2003/08/05 15:07:42
-rw-r--r--src/dxr3/dxr3_decode_spu.c84
-rw-r--r--src/dxr3/dxr3_decode_video.c122
-rw-r--r--src/dxr3/video_out_dxr3.c90
-rw-r--r--src/dxr3/video_out_dxr3.h10
4 files changed, 180 insertions, 126 deletions
diff --git a/src/dxr3/dxr3_decode_spu.c b/src/dxr3/dxr3_decode_spu.c
index 8f5abb7dd..ff24049a9 100644
--- a/src/dxr3/dxr3_decode_spu.c
+++ b/src/dxr3/dxr3_decode_spu.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: dxr3_decode_spu.c,v 1.35 2003/05/03 14:24:07 mroi Exp $
+ * $Id: dxr3_decode_spu.c,v 1.36 2003/08/05 15:07:42 mroi Exp $
*/
/* dxr3 spu decoder plugin.
@@ -126,8 +126,7 @@ typedef struct dxr3_spudec_s {
pthread_mutex_t pci_lock;
uint32_t buttonN; /* currently highlighted button */
- int aspect; /* this is needed for correct highlight placement */
- int height; /* in anamorphic menus */
+ int anamorphic; /* this is needed to detect anamorphic menus */
} dxr3_spudec_t;
/* helper functions */
@@ -230,7 +229,7 @@ static spu_decoder_t *dxr3_spudec_open_plugin(spu_decoder_class_t *class_gen, xi
this->pci.hli.hl_gi.hli_ss = 0;
this->buttonN = 1;
- this->aspect = XINE_VO_ASPECT_4_3;
+ this->anamorphic = 0;
pthread_mutex_init(&this->pci_lock, NULL);
@@ -335,7 +334,8 @@ static void dxr3_spudec_decode_data(spu_decoder_t *this_gen, buf_element_t *buf)
printf("dxr3_decode_spu: failed to set spu button (%s)\n",
strerror(errno));
pthread_mutex_unlock(&this->dxr3_vo->spu_device_lock);
- }
+ } else
+ XINE_ASSERT(0, "Requested button not available.");
}
if ((pci.hli.hl_gi.hli_ss == 0) && (this->pci.hli.hl_gi.hli_ss == 1)) {
@@ -413,7 +413,7 @@ static void dxr3_spudec_decode_data(spu_decoder_t *this_gen, buf_element_t *buf)
#endif
return;
}
- if (this->aspect == XINE_VO_ASPECT_ANAMORPHIC && !this->dxr3_vo->widescreen_enabled &&
+ if (this->anamorphic && !this->dxr3_vo->widescreen_enabled &&
this->stream->spu_channel_user == -1 && this->stream->spu_channel_letterbox >= 0) {
/* Use the letterbox version of the subpicture for letterboxed display. */
spu_channel = this->stream->spu_channel_letterbox;
@@ -575,56 +575,81 @@ static void dxr3_spudec_handle_event(dxr3_spudec_t *this)
while ((event = xine_event_get(this->event_queue))) {
#if LOG_SPU
- printf("dxr3_decode_spu: event caught: SPU_FD = %i\n",this->fd_spu);
+ printf("dxr3_decode_spu: event caught: SPU_FD = %i\n",this->fd_spu);
#endif
switch (event->type) {
case XINE_EVENT_FRAME_FORMAT_CHANGE:
- this->height = ((xine_format_change_data_t *)event->data)->height;
- this->aspect = ((xine_format_change_data_t *)event->data)->aspect;
+ /* we are in anamorphic mode, if the frame is 16:9, but not pan&scan'ed */
+ this->anamorphic =
+ (((xine_format_change_data_t *)event->data)->aspect == 3) &&
+ (((xine_format_change_data_t *)event->data)->pan_scan == 0);
#if LOG_BTN
- printf("dxr3_decode_spu: aspect changed to %d\n", this->aspect);
+ printf("dxr3_decode_spu: anamorphic mode %s\n", this->anamorphic ? "on" : "off");
#endif
break;
}
- xine_event_free(event);
+ xine_event_free(event);
}
}
static int dxr3_spudec_copy_nav_to_btn(dxr3_spudec_t *this, int32_t mode, em8300_button_t *btn)
{
- btni_t *button_ptr;
-
- if ((this->buttonN <= 0) || (this->buttonN > this->pci.hli.hl_gi.btn_ns)) {
- int buttonN;
- xine_event_t event;
+ btni_t *button_ptr = NULL;
+
+ if ((this->buttonN <= 0) || (this->buttonN > this->pci.hli.hl_gi.btn_ns))
+ return -1;
+
+ /* choosing a button from a matching button group */
+ if (this->anamorphic &&
+ !this->dxr3_vo->widescreen_enabled &&
+ this->stream->spu_channel_user == -1 &&
+ this->stream->spu_channel_letterbox != this->stream->spu_channel &&
+ this->stream->spu_channel_letterbox >= 0) {
+ unsigned int btns_per_group = 36 / this->pci.hli.hl_gi.btngr_ns;
+
+ /* use a letterbox button group for letterboxed anamorphic menus on tv out */
+ if (!button_ptr && this->pci.hli.hl_gi.btngr_ns >= 1 && (this->pci.hli.hl_gi.btngr1_dsp_ty & 2))
+ button_ptr = &this->pci.hli.btnit[0 * btns_per_group + this->buttonN - 1];
+ if (!button_ptr && this->pci.hli.hl_gi.btngr_ns >= 2 && (this->pci.hli.hl_gi.btngr2_dsp_ty & 2))
+ button_ptr = &this->pci.hli.btnit[1 * btns_per_group + this->buttonN - 1];
+ if (!button_ptr && this->pci.hli.hl_gi.btngr_ns >= 3 && (this->pci.hli.hl_gi.btngr3_dsp_ty & 2))
+ button_ptr = &this->pci.hli.btnit[2 * btns_per_group + this->buttonN - 1];
+
+ XINE_ASSERT(button_ptr, "No suitable letterbox button group found.");
+
+ } else {
+ unsigned int btns_per_group = 36 / this->pci.hli.hl_gi.btngr_ns;
+
+ /* otherwise use a normal 4:3 or widescreen button group */
+ if (!button_ptr && this->pci.hli.hl_gi.btngr_ns >= 1 && !(this->pci.hli.hl_gi.btngr1_dsp_ty & 6))
+ button_ptr = &this->pci.hli.btnit[0 * btns_per_group + this->buttonN - 1];
+ if (!button_ptr && this->pci.hli.hl_gi.btngr_ns >= 2 && !(this->pci.hli.hl_gi.btngr2_dsp_ty & 6))
+ button_ptr = &this->pci.hli.btnit[1 * btns_per_group + this->buttonN - 1];
+ if (!button_ptr && this->pci.hli.hl_gi.btngr_ns >= 3 && !(this->pci.hli.hl_gi.btngr3_dsp_ty & 6))
+ button_ptr = &this->pci.hli.btnit[2 * btns_per_group + this->buttonN - 1];
- printf("dxr3_decode_spu: Unable to select button number %i as it doesn't exist. Forcing button 1\n",
- this->buttonN);
- this->buttonN = 1;
- /* inform nav plugin that we have chosen another button */
- event.type = XINE_EVENT_INPUT_BUTTON_FORCE;
- event.stream = this->stream;
- event.data = &buttonN;
- event.data_length = sizeof(buttonN);
- buttonN = this->buttonN;
- xine_event_send(this->stream, &event);
+ }
+ if (!button_ptr) {
+ printf("dxr3_decode_spu: No suitable menu button group found, using group 1.\n");
+ button_ptr = &this->pci.hli.btnit[this->buttonN - 1];
}
- button_ptr = &this->pci.hli.btnit[this->buttonN - 1];
if(button_ptr->btn_coln != 0) {
#if LOG_BTN
fprintf(stderr, "dxr3_decode_spu: normal button clut, mode %d\n", mode);
#endif
btn->color = (this->pci.hli.btn_colit.btn_coli[button_ptr->btn_coln-1][mode] >> 16);
btn->contrast = (this->pci.hli.btn_colit.btn_coli[button_ptr->btn_coln-1][mode]);
- /* FIXME: Only the first grouping of buttons are used at the moment */
btn->left = button_ptr->x_start;
btn->top = button_ptr->y_start;
btn->right = button_ptr->x_end;
btn->bottom = button_ptr->y_end;
- if (this->aspect == XINE_VO_ASPECT_ANAMORPHIC &&
+#if 0
+ /* FIXME: we properly use button groups now, so this hack is obsolete.
+ * Remove it, after sufficient testing (see above XINE_ASSERT()). */
+ if (this->anamorphic &&
!this->dxr3_vo->widescreen_enabled &&
this->stream->spu_channel_user == -1 &&
this->stream->spu_channel_letterbox != this->stream->spu_channel &&
@@ -634,6 +659,7 @@ static int dxr3_spudec_copy_nav_to_btn(dxr3_spudec_t *this, int32_t mode, em8300
btn->top = btn->top * 3 / 4 + top_black_bar;
btn->bottom = btn->bottom * 3 / 4 + top_black_bar;
}
+#endif
return 1;
}
return -1;
diff --git a/src/dxr3/dxr3_decode_video.c b/src/dxr3/dxr3_decode_video.c
index 2f5a918ad..9786f087a 100644
--- a/src/dxr3/dxr3_decode_video.c
+++ b/src/dxr3/dxr3_decode_video.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: dxr3_decode_video.c,v 1.37 2003/08/04 03:47:09 miguelfreitas Exp $
+ * $Id: dxr3_decode_video.c,v 1.38 2003/08/05 15:07:42 mroi Exp $
*/
/* dxr3 video decoder plugin.
@@ -72,7 +72,7 @@ static decoder_info_t dxr3_video_decoder_info = {
plugin_info_t xine_plugin_info[] = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_DECODER, 14, "dxr3-mpeg2", XINE_VERSION_CODE, &dxr3_video_decoder_info, &dxr3_init_plugin },
+ { PLUGIN_VIDEO_DECODER, 15, "dxr3-mpeg2", XINE_VERSION_CODE, &dxr3_video_decoder_info, &dxr3_init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
@@ -116,17 +116,18 @@ typedef struct dxr3_decoder_s {
int width;
int height;
double ratio;
- int aspect;
+ int aspect_code;
int frame_rate_code;
int repeat_first_field; /* mpeg stream header data */
- int force_aspect; /* when input plugin has better info, we are forced
- * to use a certain aspect */
+ int force_aspect; /* when input plugin has better info, we are forced */
+ int force_pan_scan; /* to use a certain aspect or to do pan&scan */
+
int last_width;
int last_height;
- int last_aspect; /* used to detect changes for event sending */
+ int last_aspect_code; /* used to detect changes for event sending */
- int dts_offset[3];
+ unsigned int dts_offset[3];
int sync_every_frame;
int sync_retry;
int enhanced_mode;
@@ -233,10 +234,11 @@ static video_decoder_t *dxr3_open_plugin(video_decoder_class_t *class_gen, xine_
this->repeat_first_field = 0;
this->force_aspect = 0;
+ this->force_pan_scan = 0;
this->last_width = 0;
this->last_height = 0;
- this->last_aspect = 0;
+ this->last_aspect_code = 0;
this->dts_offset[0] = 21600;
this->dts_offset[1] = 21600;
@@ -303,24 +305,44 @@ static void dxr3_decode_data(video_decoder_t *this_gen, buf_element_t *buf)
/* handle aspect hints from xine-dvdnav */
if (buf->decoder_flags & BUF_FLAG_SPECIAL) {
if (buf->decoder_info[1] == BUF_SPECIAL_ASPECT) {
- this->aspect = this->force_aspect = buf->decoder_info[2];
- if (buf->decoder_info[3] == 0x1 && this->force_aspect == XINE_VO_ASPECT_ANAMORPHIC)
- /* letterboxing is denied, we have to do pan&scan */
- this->aspect = this->force_aspect = XINE_VO_ASPECT_PAN_SCAN;
- /* when aspect changed, we have to send an event for dxr3 spu decoder */
- if (!this->last_aspect || this->last_aspect != this->aspect) {
- xine_event_t event;
- xine_format_change_data_t data;
- event.type = XINE_EVENT_FRAME_FORMAT_CHANGE;
- event.stream = this->stream;
- event.data = &data;
- event.data_length = sizeof(data);
- data.width = this->last_width;
- data.height = this->last_height;
- data.aspect = this->aspect;
- xine_event_send(this->stream, &event);
- this->last_aspect = this->aspect;
+ xine_event_t event;
+ xine_format_change_data_t data;
+
+ this->aspect_code = this->force_aspect = buf->decoder_info[2];
+ if (buf->decoder_info[3] == 0x1 && this->force_aspect == 3)
+ /* letterboxing is denied, we have to do pan&scan */
+ this->force_pan_scan = 1;
+ else
+ this->force_pan_scan = 0;
+
+ /* send an event for dxr3 spu decoder */
+ event.type = XINE_EVENT_FRAME_FORMAT_CHANGE;
+ event.stream = this->stream;
+ event.data = &data;
+ event.data_length = sizeof(data);
+ data.width = this->last_width;
+ data.height = this->last_height;
+ data.aspect = this->force_aspect;
+ data.pan_scan = this->force_pan_scan;
+ xine_event_send(this->stream, &event);
+
+ /* update ratio */
+ switch (this->aspect_code) {
+ case 2:
+ this->ratio = 4.0 / 3.0;
+ break;
+ case 3:
+ this->ratio = 16.0 / 9.0;
+ break;
+ case 4:
+ this->ratio = 2.11;
+ break;
+ default:
+ if (this->have_header_info)
+ this->ratio = this->last_width / this->last_height;
}
+
+ this->last_aspect_code = this->aspect_code;
}
return;
}
@@ -381,7 +403,7 @@ static void dxr3_decode_data(video_decoder_t *this_gen, buf_element_t *buf)
/* pretend like we have decoded a frame */
img = this->stream->video_out->get_frame(this->stream->video_out,
this->width, this->height, this->ratio,
- XINE_IMGFMT_DXR3, VO_BOTH_FIELDS);
+ XINE_IMGFMT_DXR3, VO_BOTH_FIELDS | (this->force_pan_scan ? VO_PAN_SCAN_FLAG : 0));
img->pts = buf->pts;
img->bad_frame = 0;
img->duration = get_duration(this);
@@ -660,19 +682,18 @@ static void parse_mpeg_header(dxr3_decoder_t *this, uint8_t * buffer)
buffer[HEADER_OFFSET+2];
this->width = ((this->height >> 12) + 15) & ~15;
this->height = ((this->height & 0xfff) + 15) & ~15;
- this->ratio = (double)this->width/(double)this->height;
- this->aspect = buffer[HEADER_OFFSET+3] >> 4;
+ this->aspect_code = buffer[HEADER_OFFSET+3] >> 4;
this->have_header_info = 1;
- if (this->force_aspect) this->aspect = this->force_aspect;
+ if (this->force_aspect) this->aspect_code = this->force_aspect;
/* when width, height or aspect changes,
* we have to send an event for dxr3 spu decoder */
- if (!this->last_width || !this->last_height || !this->last_aspect ||
+ if (!this->last_width || !this->last_height || !this->last_aspect_code ||
(this->last_width != this->width) ||
(this->last_height != this->height) ||
- (this->last_aspect != this->aspect)) {
+ (this->last_aspect_code != this->aspect_code)) {
xine_event_t event;
xine_format_change_data_t data;
event.type = XINE_EVENT_FRAME_FORMAT_CHANGE;
@@ -681,30 +702,33 @@ static void parse_mpeg_header(dxr3_decoder_t *this, uint8_t * buffer)
event.data_length = sizeof(data);
data.width = this->width;
data.height = this->height;
- data.aspect = this->aspect;
+ data.aspect = this->aspect_code;
+ data.pan_scan = this->force_pan_scan;
xine_event_send(this->stream, &event);
- this->last_width = this->width;
- this->last_height = this->height;
- this->last_aspect = this->aspect;
- /* update stream metadata */
- this->stream->stream_info[XINE_STREAM_INFO_VIDEO_WIDTH] = this->width;
- this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HEIGHT] = this->height;
- switch (this->aspect) {
- case XINE_VO_ASPECT_SQUARE:
- this->stream->stream_info[XINE_STREAM_INFO_VIDEO_RATIO] = 10000;
+ /* update ratio */
+ switch (this->aspect_code) {
+ case 2:
+ this->ratio = 4.0 / 3.0;
break;
- case XINE_VO_ASPECT_4_3:
- this->stream->stream_info[XINE_STREAM_INFO_VIDEO_RATIO] = 10000 * 4.0 / 3.0;
+ case 3:
+ this->ratio = 16.0 / 9.0;
break;
- case XINE_VO_ASPECT_PAN_SCAN:
- case XINE_VO_ASPECT_ANAMORPHIC:
- this->stream->stream_info[XINE_STREAM_INFO_VIDEO_RATIO] = 10000 * 16.0 / 9.0;
- break;
- case XINE_VO_ASPECT_DVB:
- this->stream->stream_info[XINE_STREAM_INFO_VIDEO_RATIO] = 10000 * 2.11;
+ case 4:
+ this->ratio = 2.11;
break;
+ default:
+ this->ratio = this->width / this->height;
}
+
+ /* update stream metadata */
+ this->stream->stream_info[XINE_STREAM_INFO_VIDEO_WIDTH] = this->width;
+ this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HEIGHT] = this->height;
+ this->stream->stream_info[XINE_STREAM_INFO_VIDEO_RATIO] = 10000 * this->ratio;
+
+ this->last_width = this->width;
+ this->last_height = this->height;
+ this->last_aspect_code = this->aspect_code;
}
}
diff --git a/src/dxr3/video_out_dxr3.c b/src/dxr3/video_out_dxr3.c
index ec8e8ac2e..851e0e779 100644
--- a/src/dxr3/video_out_dxr3.c
+++ b/src/dxr3/video_out_dxr3.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_out_dxr3.c,v 1.83 2003/08/04 03:47:09 miguelfreitas Exp $
+ * $Id: video_out_dxr3.c,v 1.84 2003/08/05 15:07:42 mroi Exp $
*/
/* mpeg1 encoding video out plugin for the dxr3.
@@ -88,9 +88,9 @@ static vo_info_t vo_info_dxr3_aa = {
plugin_info_t xine_plugin_info[] = {
/* type, API, "name", version, special_info, init_function */
#ifdef HAVE_X11
- { PLUGIN_VIDEO_OUT, 15, "dxr3", XINE_VERSION_CODE, &vo_info_dxr3_x11, &dxr3_x11_init_plugin },
+ { PLUGIN_VIDEO_OUT, 16, "dxr3", XINE_VERSION_CODE, &vo_info_dxr3_x11, &dxr3_x11_init_plugin },
#endif
- { PLUGIN_VIDEO_OUT, 15, "aadxr3", XINE_VERSION_CODE, &vo_info_dxr3_aa, &dxr3_aa_init_plugin },
+ { PLUGIN_VIDEO_OUT, 16, "aadxr3", XINE_VERSION_CODE, &vo_info_dxr3_aa, &dxr3_aa_init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
@@ -356,7 +356,7 @@ static vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, const v
"video_out_dxr3: driver. See the README.dxr3 for details on configuring an encoder.\n");
/* init aspect */
- dxr3_set_property(&this->vo_driver, VO_PROP_ASPECT_RATIO, XINE_VO_ASPECT_4_3);
+ this->aspect = dxr3_set_property(&this->vo_driver, VO_PROP_ASPECT_RATIO, XINE_VO_ASPECT_4_3);
/* init brightness/contrast/saturation */
dxr3_set_property(&this->vo_driver, VO_PROP_BRIGHTNESS, 500);
@@ -540,7 +540,7 @@ static void dxr3_update_frame_format(vo_driver_t *this_gen, vo_frame_t *frame_ge
{
dxr3_driver_t *this = (dxr3_driver_t *)this_gen;
dxr3_frame_t *frame = (dxr3_frame_t *)frame_gen;
- int oheight;
+ uint32_t oheight;
if (format == XINE_IMGFMT_DXR3) { /* talking to dxr3 decoder */
/* a bit of a hack. we must release the em8300_mv fd for
@@ -563,7 +563,11 @@ static void dxr3_update_frame_format(vo_driver_t *this_gen, vo_frame_t *frame_ge
frame->vo_frame.height = height;
frame->vo_frame.ratio = ratio;
frame->oheight = height;
- frame->aspect = 0;
+ if (ratio < 1.5)
+ frame->aspect = XINE_VO_ASPECT_4_3;
+ else
+ frame->aspect = XINE_VO_ASPECT_ANAMORPHIC;
+ frame->pan_scan = flags & VO_PAN_SCAN_FLAG;
if (frame->mem) {
free(frame->mem);
@@ -577,6 +581,14 @@ static void dxr3_update_frame_format(vo_driver_t *this_gen, vo_frame_t *frame_ge
/* the following is for the mpeg encoding part only */
+ if (!this->add_bars)
+ /* don't add black bars; assume source is in 4:3 */
+ ratio = 4.0/3.0;
+
+ if (ratio <= 0.0)
+ /* correct some crazy aspects */
+ ratio = (double)width / (double)height;
+
frame->vo_frame.ratio = ratio;
frame->pan_scan = 0;
frame->aspect = this->aspect;
@@ -587,21 +599,16 @@ static void dxr3_update_frame_format(vo_driver_t *this_gen, vo_frame_t *frame_ge
this->scale.force_redraw = 1;
}
- if (this->add_bars == 0) {
- /* don't add black bars; assume source is in 4:3 */
- ratio = 4.0/3.0;
- }
-
if ((this->video_width != width) || (this->video_iheight != height) ||
- (this->video_ratio != ratio)) {
-
+ (fabs(this->video_ratio - ratio) > 0.01)) {
+
/* try anamorphic */
frame->aspect = XINE_VO_ASPECT_ANAMORPHIC;
- oheight = height * (ratio / (16.0 / 9.0));
+ oheight = (double)height * (ratio / (16.0 / 9.0)) + .5;
if (oheight < height) {
/* frame too high, try 4:3 */
frame->aspect = XINE_VO_ASPECT_4_3;
- oheight = height * (ratio / (4.0 / 3.0));
+ oheight = (double)height * (ratio / (4.0 / 3.0)) + .5;
}
if (oheight < height) {
/* still too high, use full height */
@@ -831,22 +838,18 @@ static void dxr3_display_frame(vo_driver_t *this_gen, vo_frame_t *frame_gen)
dxr3_driver_t *this = (dxr3_driver_t *)this_gen;
dxr3_frame_t *frame = (dxr3_frame_t *)frame_gen;
- /* use correct aspect and pan&scan setting */
- if (!frame->aspect) {
- /* aspect not determined yet, set it now */
- frame->aspect = this->aspect;
- frame->pan_scan = 0;
-
- if (frame->vo_frame.ratio < 1.4)
- frame->aspect = XINE_VO_ASPECT_4_3;
- else
- frame->aspect = XINE_VO_ASPECT_ANAMORPHIC;
- }
-
if ((this->widescreen_enabled ? XINE_VO_ASPECT_4_3 : frame->aspect) != this->aspect)
- dxr3_set_property(this_gen, VO_PROP_ASPECT_RATIO,
+ this->aspect = dxr3_set_property(this_gen, VO_PROP_ASPECT_RATIO,
(this->widescreen_enabled ? XINE_VO_ASPECT_4_3 : frame->aspect));
-
+ if (frame->pan_scan && !this->pan_scan) {
+ dxr3_set_property(this_gen, VO_PROP_ZOOM_X, 1);
+ this->pan_scan = 1;
+ }
+ if (!frame->pan_scan && this->pan_scan) {
+ this->pan_scan = 0;
+ dxr3_set_property(this_gen, VO_PROP_ZOOM_X, -1);
+ }
+
#ifdef HAVE_X11
if (this->overlay_enabled) {
if (this->scale.force_redraw ||
@@ -954,13 +957,8 @@ static int dxr3_set_property(vo_driver_t *this_gen, int property, int value)
bcs_changed = 1;
break;
case VO_PROP_ASPECT_RATIO:
- /* xitk-ui increments the value, so we make
+ /* xine-ui increments the value, so we make
* just a two value "loop" */
- /*
- if (value != ASPECT_FULL && value != ASPECT_AUTO)
- value = ASPECT_ANAMORPHIC;
- */
- this->aspect = value;
if (this->pan_scan) break;
if (this->widescreen_enabled) {
/* FIXME: We should send an anamorphic hint to widescreen tvs, so they
@@ -968,16 +966,22 @@ static int dxr3_set_property(vo_driver_t *this_gen, int property, int value)
break;
}
- if (value == XINE_VO_ASPECT_ANAMORPHIC) {
-#if LOG_VID
- printf("video_out_dxr3: setting aspect ratio to anamorphic\n");
-#endif
- val = EM8300_ASPECTRATIO_16_9;
- } else {
+ switch(value) {
+ case XINE_VO_ASPECT_SQUARE:
+ case XINE_VO_ASPECT_4_3:
#if LOG_VID
printf("video_out_dxr3: setting aspect ratio to full\n");
#endif
val = EM8300_ASPECTRATIO_4_3;
+ value = XINE_VO_ASPECT_4_3;
+ break;
+ case XINE_VO_ASPECT_ANAMORPHIC:
+ case XINE_VO_ASPECT_DVB:
+#if LOG_VID
+ printf("video_out_dxr3: setting aspect ratio to anamorphic\n");
+#endif
+ val = EM8300_ASPECTRATIO_16_9;
+ value = XINE_VO_ASPECT_ANAMORPHIC;
}
if (ioctl(this->fd_control, EM8300_IOCTL_SET_ASPECTRATIO, &val))
@@ -1063,7 +1067,7 @@ static int dxr3_gui_data_exchange(vo_driver_t *this_gen, int data_type, void *da
this->win = (Drawable)data;
XFreeGC(this->display, this->gc);
this->gc = XCreateGC(this->display, this->win, 0, NULL);
- dxr3_set_property(this_gen, VO_PROP_ASPECT_RATIO, this->aspect);
+ this->aspect = dxr3_set_property(this_gen, VO_PROP_ASPECT_RATIO, this->aspect);
break;
case XINE_GUI_SEND_TRANSLATE_GUI_TO_VIDEO:
{
@@ -1096,7 +1100,7 @@ static int dxr3_gui_data_exchange(vo_driver_t *this_gen, int data_type, void *da
this->scale.force_redraw = 1;
}
ioctl(this->fd_control, EM8300_IOCTL_OVERLAY_SETMODE, &val);
- dxr3_set_property(this_gen, VO_PROP_ASPECT_RATIO, this->aspect);
+ this->aspect = dxr3_set_property(this_gen, VO_PROP_ASPECT_RATIO, this->aspect);
}
break;
default:
diff --git a/src/dxr3/video_out_dxr3.h b/src/dxr3/video_out_dxr3.h
index 3c6c40359..6e78ab86b 100644
--- a/src/dxr3/video_out_dxr3.h
+++ b/src/dxr3/video_out_dxr3.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_out_dxr3.h,v 1.17 2003/08/04 03:47:09 miguelfreitas Exp $
+ * $Id: video_out_dxr3.h,v 1.18 2003/08/05 15:07:42 mroi Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -107,9 +107,9 @@ typedef struct dxr3_driver_s {
spu_encoder_t *spu_enc; /* spu encoder */
int need_update; /* the mpeg encoder needs to be updated */
- int video_iheight; /* input height (before adding black bars) */
- int video_oheight; /* output height (after adding black bars) */
- int video_width;
+ uint32_t video_iheight; /* input height (before adding black bars) */
+ uint32_t video_oheight; /* output height (after adding black bars) */
+ uint32_t video_width;
double video_ratio;
int top_bar; /* the height of the upper black bar */
@@ -128,7 +128,7 @@ typedef struct dxr3_driver_s {
typedef struct dxr3_frame_s {
vo_frame_t vo_frame;
- int oheight;
+ uint32_t oheight;
int aspect, pan_scan;
uint8_t *mem; /* allocated for YV12 or YUY2 buffers */
uint8_t *real_base[3]; /* yuv/yuy2 buffers in mem aligned on 16 */