diff options
Diffstat (limited to 'client')
| -rw-r--r-- | client/mainwindow.cc | 17 | ||||
| -rw-r--r-- | client/player.cc | 21 | ||||
| -rw-r--r-- | client/player.h | 2 | 
3 files changed, 18 insertions, 22 deletions
| diff --git a/client/mainwindow.cc b/client/mainwindow.cc index 8d7c04f..dd05b69 100644 --- a/client/mainwindow.cc +++ b/client/mainwindow.cc @@ -112,22 +112,11 @@ MainWindow::MainWindow(Decoder *d): QWidget()    // Create history bar    history = new HistoryFrame();    layout->addWidget(history, 0,4, 2,1); -  history->addHistoryItem(new HistoryWidget(new QPixmap(PIXMAP_MUTE))); -  history->addHistoryItem(new HistoryWidget(new QPixmap(PIXMAP_UNMUTE))); -  history->addHistoryItem(new HistoryWidget(new QPixmap(PIXMAP_STOP))); -  history->addHistoryItem(new HistoryWidget(new QPixmap(PIXMAP_RECORD))); -  history->addHistoryItem(new HistoryWidget(new QPixmap(PIXMAP_FREEZE))); -  history->addHistoryItem(new HistoryWidget(new QPixmap(PIXMAP_UNFREEZE))); -  history->addHistoryItem(new HistoryWidget(new QPixmap(PIXMAP_CPR))); -  history->addHistoryItem(new HistoryWidget(new QPixmap(PIXMAP_CLEAR))); -  history->addHistoryItem(new HistoryWidget(new QPixmap(PIXMAP_DUMMY))); -  history->addHistoryItem(new HistoryWidget(new QPixmap(PIXMAP_LOGO_SMALL))); -    // Create statusbar    show(); -  //setWindowState(Qt::WindowFullScreen); +  // setWindowState(Qt::WindowFullScreen);    resize(800, 600);    MIaV::info->log("MIaV is ready."); @@ -165,8 +154,10 @@ void MainWindow::snapshot_clicked()    char rgb[720 * 576 * 4]; +  //  QImage screenshot((uchar*)rgb, 720, 576, QImage::Format_RGB32);    QImage screenshot((uchar*)rgb, 720, 576, QImage::Format_RGB32); -  decoder->snapshot(rgb); +  //  decoder->snapshot(rgb); +  decoder->snapshot((char*)screenshot.bits());    QPixmap *p = new QPixmap();    *p = QPixmap::fromImage(screenshot); diff --git a/client/player.cc b/client/player.cc index cb62de8..a7d0a7c 100644 --- a/client/player.cc +++ b/client/player.cc @@ -29,22 +29,23 @@  #define WIDTH 720  #define HEIGHT 576 -Player::Player(QWidget *w, Decoder *d) : -  dvdecoder(DV::ColorBest) +Player::Player(QWidget *w, Decoder *d)   {    widget = w;    decoder = d; +  dvdecoder = new LibDVWrapper(DV::ColorBest, DV::PAL, DV::YUV_422);    render.init(widget, WIDTH, HEIGHT);    connect(this, SIGNAL(timeout()), this, SLOT(show_frame())); -  dvdecoder.setOutputBuffer(render.getDisplayData()); +  dvdecoder->setOutputBuffer(render.getDisplayData());  }  Player::~Player()  {    render.end(); +  delete dvdecoder;  }  void Player::show_frame() @@ -52,15 +53,19 @@ void Player::show_frame()    char *frame;    frame = decoder->pframeAcquire(); // Acquire frame data -  dvdecoder.decode(frame); +  dvdecoder->decode(frame);    decoder->pframeRelease(); // Release frame data -  if(widget->width() /  4 < widget->height() / 3) { +  if((double)widget->width() /  WIDTH < (double)widget->height() / HEIGHT) {      render.width = widget->width(); -    render.height = render.width / 4 * 3; +    render.height = (unsigned int)((double)render.width / (double)WIDTH * (double)HEIGHT);    } else {      render.height = widget->height(); -    render.width = render.height / 3 * 4; +    render.width = (unsigned int)((double)render.height / (double)HEIGHT * (double)WIDTH);    } -  render.display(WIDTH / 2, HEIGHT / 2); + +  //  render.width = widget->width(); +  //  render.height = widget->height(); + +  render.display(WIDTH, HEIGHT);  } diff --git a/client/player.h b/client/player.h index 4aedb05..d56ae4b 100644 --- a/client/player.h +++ b/client/player.h @@ -54,7 +54,7 @@ public slots:    void show_frame();  private: -  LibDVWrapper dvdecoder; +  LibDVWrapper *dvdecoder;    Decoder *decoder;    QWidget *widget; | 
