From 7d7ee51b2d4284f936a40b0edce760fbf226b93a Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 19 Apr 2005 11:35:41 +0000 Subject: *** empty log message *** --- src/dv1394.cc | 6 +++++- src/player.cc | 23 +++++------------------ 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/src/dv1394.cc b/src/dv1394.cc index 8d62605..339d192 100644 --- a/src/dv1394.cc +++ b/src/dv1394.cc @@ -112,12 +112,14 @@ dv1394::dv1394(Error *e, int port, int channel) // Get handle to firewire channels handle = raw1394_new_handle(); if(!handle) { + // errobj->pushError(""); fprintf( stderr, "raw1394 - failed to get handle: %s.\n", strerror( errno ) ); exit( EXIT_FAILURE ); } // how many adapters are hooked in? if((n_ports = raw1394_get_port_info(handle, pinf, 16)) < 0 ) { + // errobj->pushError(""); fprintf( stderr, "raw1394 - failed to get port info: %s.\n", strerror( errno ) ); raw1394_destroy_handle( handle ); exit( EXIT_FAILURE ); @@ -125,7 +127,7 @@ dv1394::dv1394(Error *e, int port, int channel) // Tell raw1394 which host adapter to use if(raw1394_set_port(handle, port) < 0 ) { - errobj->pushError("Error while opening codec for input stream."); + // errobj->pushError(""); fprintf( stderr, "raw1394 - failed to set port: %s.\n", strerror( errno ) ); exit( EXIT_FAILURE ); } @@ -138,6 +140,8 @@ dv1394::dv1394(Error *e, int port, int channel) dv1394::~dv1394() { + // Close firewire connection. + raw1394_destroy_handle(handle); } unsigned char *dv1394::readFrame() diff --git a/src/player.cc b/src/player.cc index 085f4df..df9668e 100644 --- a/src/player.cc +++ b/src/player.cc @@ -91,16 +91,10 @@ void Player::player() SDL_Rect rect; Frame *frame; // AVPicture pict; - unsigned char pixel_buffer[720 * 576 * 3]; + // unsigned char pixel_buffer[720 * 576 * 3]; unsigned char *pxs[3]; int pitches[3]; - pitches[0] = 720 * 2; - pxs[0] = pixel_buffer; - pxs[1] = pixel_buffer; - pxs[2] = pixel_buffer; - - int i; struct timespec ts; @@ -111,14 +105,14 @@ void Player::player() rect.y = 0; rect.w = DISPLAYWIDTH; rect.h = DISPLAYHEIGHT; - /* + //+++++Reference to the overlay pixels/pitches, only after creating a new overlay+++++ // ????????? for(i = 0; i < 3; i++) { - pict.data[i] = overlay->pixels[i]; - pict.linesize[i] = overlay->pitches[i]; + pxs[i] = overlay->pixels[i]; + pitches[i] = overlay->pitches[i]; } - */ + dv_decoder_t *decoder = NULL; decoder = dv_decoder_new(FALSE, FALSE, TRUE); decoder->quality = DV_QUALITY_BEST; @@ -147,10 +141,6 @@ void Player::player() pthread_mutex_unlock(mutex); if(!frame) break; - // img_convert(&pict, PIX_FMT_YUV420P, (AVPicture *)f->frame, - // PIX_FMT_YUV420P, DISPLAYWIDTH, DISPLAYHEIGHT); - - // libdv img decode dv_decode_full_frame(decoder, (const uint8_t*)frame->data, @@ -159,9 +149,6 @@ void Player::player() pitches); SDL_LockYUVOverlay(overlay); - overlay->pitches[0] = pitches[0]; - overlay->pitches[1] = pitches[1]; - overlay->pitches[2] = pitches[2]; overlay->pixels = pxs; SDL_UnlockYUVOverlay(overlay); SDL_DisplayYUVOverlay(overlay, &rect); -- cgit v1.2.3