Exemple #1
0
  friend void set_params(sink& s, video_mode vm, rect const& src, rect const& dst) {
  	mvdu_video_params params = {0};

    params.in_mode = is_progressive(vm) ? MVDU_VIDEO_IN_FRAME_TO_P : MVDU_VIDEO_IN_FRAME_TO_I;
    params.out_mode = (int)vm;
    params.pixel_format = MVDU_PIXEL_FORMAT_420;
    params.planes_nr = MVDU_TWO_PLANES;
    params.plane_format = MVDU_PLANE_FORMAT_MACROBLOCK;
    params.color_space =  is_hd(vm) ? MVDU_COLOR_SPACE_HD : MVDU_COLOR_SPACE_SD;
    params.valid = MVDU_VALID_FORMAT | MVDU_VALID_FILTER | MVDU_VALID_IN_MODE | MVDU_VALID_OUT_MODE | MVDU_VALID_SRC | MVDU_VALID_DST;
    params.byte_order = MVDU_VIDEO_BIG_ENDIAN;
    params.use_dropper = 0;

	  params.src.x = src.x;
	  params.src.y = src.y;
	  params.src.w = src.w;
	  params.src.h = src.h;
    params.src.h = std::min(1080, params.src.h);

	  params.dst.x = dst.x;
	  params.dst.y = dst.y;
	  params.dst.w = dst.w;
	  params.dst.h = dst.h;

    MVDU_MACROBLOCKS_PER_LINE_Y(&params) = buffer_width / 16;
    MVDU_MACROBLOCKS_PER_LINE_C(&params) = buffer_width / 16;
    MVDU_OFFSET_C(&params) = buffer_chroma_offset;

	  if(ioctl(s.p->fd.native_handle(), VIDIOC_S_PARAMS, &params) < 0) throw std::system_error(errno, std::system_category()); 
  }
Exemple #2
0
QString PlayerContext::GetPlayMessage(void) const
{
    QString mesg = QObject::tr("Play");
    if (ts_normal != 1.0)
    {
        if (ts_normal == 0.5)
            mesg += QString(" 1/2x");
        else if (0.32 < ts_normal && ts_normal < 0.34)
            mesg += QString(" 1/3x");
        else if (ts_normal == 0.25)
            mesg += QString(" 1/4x");
        else if (ts_normal == 0.125)
            mesg += QString(" 1/8x");
        else if (ts_normal == 0.0625)
            mesg += QString(" 1/16x");
        else
            mesg += QString(" %1x").arg(ts_normal);
    }

    if (0)
    {
        QMutexLocker locker(&deletePlayerLock);
        FrameScanType scan = player->GetScanType();
        if (is_progressive(scan) || is_interlaced(scan))
            mesg += " (" + toString(scan, true) + ")";
    }

    return mesg;
}
Exemple #3
0
inline
constexpr bool is_valid_video_mode(unsigned _height, int _rate, bool progressive, bool hd) {
  return 
    height(construct_video_mode(_height, _rate, progressive, hd)) == _height 
    && framerate(construct_video_mode(_height, _rate, progressive, hd)) == _rate
    && is_progressive(construct_video_mode(_height, _rate, progressive, hd))
    && is_hd(construct_video_mode(_height, _rate, progressive, hd));
}