int AndroidVideoOutput::InitScaler (AVStream *vstream) { if (mpImgConvertCtx) { sws_freeContext (mpImgConvertCtx); mpImgConvertCtx = NULL; } #if 0 if (iVideoDisplayWidth <= 0 || iVideoDisplayHeight <= 0) { ERROR ("video display size is invalid! width=%d, height=%d", iVideoDisplayWidth, iVideoDisplayHeight); return -1; } #endif if (vstream == NULL) { ERROR ("vstream == NULL!"); return -1; } AVCodecContext *codecCtx = vstream->codec; if (codecCtx == NULL) { ERROR ("error! codecCtx == NULL!"); return -1; } int width = 0, height = 0; width = codecCtx->width; height = codecCtx->height; SetFrameSize (width, height); SetDisplaySize (width, height); SwsContext *img_convert_ctx = sws_getContext (width, height, codecCtx->pix_fmt, iVideoDisplayWidth, iVideoDisplayHeight, PIX_FMT_RGB565, SWS_BICUBIC, NULL, NULL, NULL); if (img_convert_ctx == NULL) { ERROR ("img_convert_ctx == NULL!"); } mpImgConvertCtx = img_convert_ctx; return 0; }
ColorListItem::ColorListItem(const char* text, uint32 level, bool expanded) : BStringItem(text, level, expanded) { SetFrameColor((rgb_color){0, 0, 0}); SetColor((rgb_color){255, 255, 255}); SetFrameSize(BRect(0, 0, 20, 10)); SetFrameAlignment(B_ALIGN_LEFT); }
Button::Button() : mHasMouse(false), mKeyPressed(false), mMousePressed(false), mAlignment(Graphics::CENTER), mSpacing(4) { SetFocusable(true); AdjustSize(); SetFrameSize(1); addMouseListener(this); addKeyListener(this); addFocusListener(this); }
CBCGPAnalogClock::CBCGPAnalogClock(CBCGPVisualContainer* pContainer) : CBCGPCircularGaugeImpl(pContainer) { m_nTimerID = 0; m_bSecondHand = TRUE; m_pDate = NULL; SetColors(CBCGPCircularGaugeColors::BCGP_CIRCULAR_GAUGE_WHITE); SetFrameSize(6); SetClosedRange(0, 12); // 0 - 12 hours SetStep(.2); // 1/5 SetMajorTickMarkStep(5); SetTickMarkStyle(CBCGPCircularGaugeScale::BCGP_TICKMARK_CIRCLE, TRUE, 7.); SetTickMarkSize(3, FALSE); AddPointer( CBCGPCircularGaugePointer(CBCGPCircularGaugePointer::BCGP_GAUGE_NEEDLE_TRIANGLE, .6)); AddPointer( CBCGPCircularGaugePointer(CBCGPCircularGaugePointer::BCGP_GAUGE_NEEDLE_RECT, 0.0, 1.0, TRUE)); }
Sprite::Sprite(Texture *t, int width, int height, int animspeed) { SetTexture(t); SetFrameSize(width, height); animSpeed = animspeed; };