summaryrefslogtreecommitdiff
path: root/src/xine-engine/video_out.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xine-engine/video_out.c')
-rw-r--r--src/xine-engine/video_out.c80
1 files changed, 72 insertions, 8 deletions
diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c
index 5b539fc89..14c0a3ac1 100644
--- a/src/xine-engine/video_out.c
+++ b/src/xine-engine/video_out.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.c,v 1.102 2002/08/03 20:42:32 siggi Exp $
+ * $Id: video_out.c,v 1.103 2002/09/04 23:31:13 guenter Exp $
*
* frame allocation / queuing / scheduling / output functions
*/
@@ -36,9 +36,9 @@
#include <pthread.h>
#include <assert.h>
+#include "xine_internal.h"
#include "video_out.h"
#include "metronom.h"
-#include "xine_internal.h"
#include "xineutils.h"
/*
@@ -51,7 +51,7 @@ typedef struct {
vo_instance_t vo; /* public part */
- vo_driver_t *driver;
+ xine_vo_driver_t *driver;
metronom_t *metronom;
xine_t *xine;
@@ -365,7 +365,7 @@ static vo_frame_t * duplicate_frame( vos_t *this, vo_frame_t *img ) {
image_size = img->pitches[0] * img->height;
- if (img->format == IMGFMT_YV12) {
+ if (img->format == XINE_IMGFMT_YV12) {
if (img->base[0])
xine_fast_memcpy(dupl->base[0], img->base[0], image_size);
if (img->base[1])
@@ -382,7 +382,7 @@ static vo_frame_t * duplicate_frame( vos_t *this, vo_frame_t *img ) {
dupl->vpts = 0;
dupl->duration = img->duration;
- if (img->format == IMGFMT_YV12) {
+ if (img->format == XINE_IMGFMT_YV12) {
if (img->copy) {
int height = img->height;
uint8_t* src[3];
@@ -620,7 +620,7 @@ static void paused_loop( vos_t *this, int64_t vpts )
/* prevent decoder thread from allocating new frames */
this->free_img_buf_queue->locked_for_read = 1;
- while( this->xine->speed == SPEED_PAUSE ) {
+ while( this->xine->speed == XINE_SPEED_PAUSE ) {
/* we need at least one free frame to keep going */
if( this->display_img_buf_queue->first &&
@@ -747,7 +747,7 @@ static void *video_out_loop (void *this_gen) {
do {
vpts = this->metronom->get_current_time (this->metronom);
- if( this->xine->speed == SPEED_PAUSE )
+ if( this->xine->speed == XINE_SPEED_PAUSE )
paused_loop( this, vpts );
usec_to_sleep = (next_frame_vpts - vpts) * 100 / 9;
@@ -798,6 +798,70 @@ static uint32_t vo_get_capabilities (vo_instance_t *this_gen) {
return this->driver->get_capabilities (this->driver);
}
+static vo_frame_t * vo_duplicate_frame( vo_instance_t *this_gen, vo_frame_t *img ) {
+
+ vo_frame_t *dupl;
+ /* vos_t *this = (vos_t *) this_gen; */
+ int image_size;
+
+ dupl = vo_get_frame (this_gen, img->width, img->height, img->ratio,
+ img->format, VO_BOTH_FIELDS );
+
+ image_size = img->pitches[0] * img->height;
+
+ if (img->format == XINE_IMGFMT_YV12) {
+ /* The dxr3 video out plugin does not allocate memory for the dxr3
+ * decoder, so we must check for NULL */
+ if (img->base[0])
+ xine_fast_memcpy(dupl->base[0], img->base[0], image_size);
+ if (img->base[1])
+ xine_fast_memcpy(dupl->base[1], img->base[1], img->pitches[1] * ((img->height+1)/2));
+ if (img->base[2])
+ xine_fast_memcpy(dupl->base[2], img->base[2], img->pitches[2] * ((img->height+1)/2));
+ } else {
+ if (img->base[0])
+ xine_fast_memcpy(dupl->base[0], img->base[0], image_size);
+ }
+
+ dupl->bad_frame = 0;
+ dupl->pts = 0;
+ dupl->vpts = 0;
+ dupl->duration = img->duration;
+
+ /* Support copy; Dangerous, since some decoders may use a source that's
+ * not dupl->base. It's up to the copy implementation to check for NULL */
+ if (img->format == XINE_IMGFMT_YV12) {
+ if (img->copy) {
+ int height = img->height;
+ uint8_t* src[3];
+
+ src[0] = dupl->base[0];
+ src[1] = dupl->base[1];
+ src[2] = dupl->base[2];
+ while ((height -= 16) >= 0) {
+ dupl->copy(dupl, src);
+ src[0] += 16 * img->pitches[0];
+ src[1] += 8 * img->pitches[1];
+ src[2] += 8 * img->pitches[2];
+ }
+ }
+ } else {
+ if (img->copy) {
+ int height = img->height;
+ uint8_t* src[3];
+
+ src[0] = dupl->base[0];
+
+ while ((height -= 16) >= 0) {
+ dupl->copy(dupl, src);
+ src[0] += 16 * img->pitches[0];
+ }
+ }
+ }
+
+ return dupl;
+}
+
static void vo_open (vo_instance_t *this_gen) {
vos_t *this = (vos_t *) this_gen;
@@ -886,7 +950,7 @@ static void vo_enable_overlay (vo_instance_t *this_gen, int overlay_enabled) {
}
-vo_instance_t *vo_new_instance (vo_driver_t *driver, xine_t *xine) {
+vo_instance_t *vo_new_instance (xine_vo_driver_t *driver, xine_t *xine) {
vos_t *this;
int i;