예제 #1
0
void video_display(VideoState *is) {

//  SDL_Rect rect;
  VideoPicture *vp;
  //AVPicture pict;
  float aspect_ratio;
  int w, h, x, y;
  //int i;

  vp = &is->pictq[is->pictq_rindex];
  if(vp->bmp) {
	  /*printf("sasasasa--- %d\n", vp->bmp_size);

	  FILE *fp;
	  fp = fopen("/Users/wseemann/Desktop/test.png", "w+");
	  fwrite(vp->bmp, sizeof(vp->bmp), vp->bmp_size, fp);
	  fclose(fp);*/

    if(is->video_st->codec->sample_aspect_ratio.num == 0) {
      aspect_ratio = 0;
    } else {
      aspect_ratio = av_q2d(is->video_st->codec->sample_aspect_ratio) *
	is->video_st->codec->width / is->video_st->codec->height;
    }
    if(aspect_ratio <= 0.0) {
      aspect_ratio = (float)is->video_st->codec->width /
	(float)is->video_st->codec->height;
    }
    /*h = is->video_player->screen->h;
    w = ((int)rint(h * aspect_ratio)) & -3;
    if(w > is->video_player->screen->w) {
      w = is->video_player->screen->w;
      h = ((int)rint(w / aspect_ratio)) & -3;
    }
    x = (is->video_player->screen->w - w) / 2;
    y = (is->video_player->screen->h - h) / 2;*/

    displayOverlay(&is->video_player, vp->bmp, x, y, w, h);
  }
}
void MgrStereoHand::showOverlay(QString text, int time){
	displayOverlay(leftCamWindow->name, text.toStdString(), time);
	displayOverlay(rightCamWindow->name, text.toStdString(), time);
}