From e135953b099687f39fc03557f901fdec00903d35 Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 19 Apr 2005 19:16:19 +0000 Subject: some experiments with the dc decoder- --- src/frame.cc | 2 +- src/frame.h | 4 ++-- src/miav.conf | 2 +- src/player.cc | 24 +++++++++++++----------- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/frame.cc b/src/frame.cc index 61b2ec7..6a1ba70 100644 --- a/src/frame.cc +++ b/src/frame.cc @@ -28,7 +28,7 @@ #include "debug.h" -Frame::Frame(void *d, int sz) +Frame::Frame(unsigned char *d, int sz) { data = d; size = sz; diff --git a/src/frame.h b/src/frame.h index 8894dff..8005520 100644 --- a/src/frame.h +++ b/src/frame.h @@ -28,10 +28,10 @@ class Frame { public: - Frame(void *d, int sz); + Frame(unsigned char *d, int sz); ~Frame(); - void *data; + unsigned char *data; int size; }; diff --git a/src/miav.conf b/src/miav.conf index 9394469..aa85797 100644 --- a/src/miav.conf +++ b/src/miav.conf @@ -18,5 +18,5 @@ pixel_height = 768 # How and where to connect to the miav server? server_addr = "192.168.0.10" -server_port = 30001 +server_port = 30000 diff --git a/src/player.cc b/src/player.cc index df9668e..5573b79 100644 --- a/src/player.cc +++ b/src/player.cc @@ -90,7 +90,7 @@ void Player::player() SDL_Event event; SDL_Rect rect; Frame *frame; - // AVPicture pict; + // unsigned char pixel_buffer[720 * 576 * 3]; unsigned char *pxs[3]; int pitches[3]; @@ -106,16 +106,15 @@ void Player::player() rect.w = DISPLAYWIDTH; rect.h = DISPLAYHEIGHT; - //+++++Reference to the overlay pixels/pitches, only after creating a new overlay+++++ - // ????????? + // Reference to the overlay pixels/pitches. for(i = 0; i < 3; 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; + dv_decoder_t *decoder = dv_decoder_new(0/*this value is unused*/, FALSE, FALSE); + decoder->quality = DV_QUALITY_BEST; + //decoder->system = e_dv_system_625_50; while(*running) { // Wait for the semaphore to be free... then run @@ -141,18 +140,21 @@ void Player::player() pthread_mutex_unlock(mutex); if(!frame) break; + fprintf(stderr, "[%d]", dv_is_PAL(decoder)); fflush(stderr); + SDL_LockYUVOverlay(overlay); + // libdv img decode dv_decode_full_frame(decoder, - (const uint8_t*)frame->data, + frame->data, e_dv_color_yuv, pxs, pitches); - SDL_LockYUVOverlay(overlay); - overlay->pixels = pxs; + dv_report_video_error(decoder, frame->data); + // overlay->pixels = pxs; SDL_UnlockYUVOverlay(overlay); SDL_DisplayYUVOverlay(overlay, &rect); - // delete f; + // delete frame; break; case SDL_QUIT: @@ -173,7 +175,7 @@ void Player::player() pthread_mutex_lock(mutex); frame = queue->pop(); pthread_mutex_unlock(mutex); - // if(f) delete f; + // if(frame) delete frame; } void Player::run() -- cgit v1.2.3