当前位置: 首页>>代码示例>>C++>>正文


C++ SDL_FreeYUVOverlay函数代码示例

本文整理汇总了C++中SDL_FreeYUVOverlay函数的典型用法代码示例。如果您正苦于以下问题:C++ SDL_FreeYUVOverlay函数的具体用法?C++ SDL_FreeYUVOverlay怎么用?C++ SDL_FreeYUVOverlay使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SDL_FreeYUVOverlay函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SDL_calloc

SDL_Overlay *DirectFB_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display)
{
  SDL_Overlay *overlay;
  struct private_yuvhwdata *hwdata;

  /* Create the overlay structure */
  overlay = SDL_calloc (1, sizeof(SDL_Overlay));
  if (!overlay)
    {
      SDL_OutOfMemory();
      return NULL;
    }
	
  /* Fill in the basic members */
  overlay->format = format;
  overlay->w = width;
  overlay->h = height;

  /* Set up the YUV surface function structure */
  overlay->hwfuncs = &directfb_yuvfuncs;

  /* Create the pixel data and lookup tables */
  hwdata = SDL_calloc(1, sizeof(struct private_yuvhwdata));
  overlay->hwdata = hwdata;
  if (!hwdata)
    {
      SDL_OutOfMemory();
      SDL_FreeYUVOverlay (overlay);
      return NULL;
    }

  if (CreateYUVSurface (this, hwdata, width, height, format))
    {
      SDL_FreeYUVOverlay (overlay);
      return NULL;
    }

  overlay->hw_overlay = 1;

  /* Set up the plane pointers */
  overlay->pitches = hwdata->pitches;
  overlay->pixels = hwdata->planes;
  switch (format)
    {
    case SDL_YV12_OVERLAY:
    case SDL_IYUV_OVERLAY:
      overlay->planes = 3;
      break;
    default:
      overlay->planes = 1;
      break;
    }

  /* We're all done.. */
  return overlay;
}
开发者ID:3bu1,项目名称:crossbridge,代码行数:56,代码来源:SDL_DirectFB_yuv.c

示例2: alloc_picture

void alloc_picture(void *userdata) {

    VideoState *is = (VideoState *)userdata;
    VideoPicture *vp;

    vp = &is->pictq[is->pictq_windex];

    if(vp->bmp) {
        // we already have one make another, bigger/smaller
        SDL_FreeYUVOverlay(vp->bmp);
    }

    // Allocate a place to put our YUV image on that screen
    vp->bmp = SDL_CreateYUVOverlay(is->video_st->codec->width,
                                   is->video_st->codec->height,
                                   SDL_YV12_OVERLAY,
                                   screen);
    vp->width = is->video_st->codec->width;
    vp->height = is->video_st->codec->height;

    SDL_LockMutex(is->pictq_mutex);
    vp->allocated = 1;
    SDL_CondSignal(is->pictq_cond);
    SDL_UnlockMutex(is->pictq_mutex);

}
开发者ID:elad-perets,项目名称:dranger_ffmpeg_ubuntu_trusty,代码行数:26,代码来源:tutorial07.c

示例3: ffmovie_cleanup

static void ffmovie_cleanup(FFMovie *movie) {
    if(!movie)
        return;

    if(movie->audio_st) {
        packet_queue_abort(&movie->audioq);
        SDL_CloseAudio();
        packet_queue_end(&movie->audioq);
        avcodec_close(&movie->audio_st->codec);
        movie->audio_st = NULL;
    }

    if(movie->video_st) {
        avcodec_close(&movie->video_st->codec);
        movie->video_st = NULL;
    }

    if (movie->context) {
        av_close_input_file(movie->context);
        movie->context = NULL;
    }

    if(movie->dest_mutex) {
        SDL_DestroyMutex(movie->dest_mutex);
        movie->dest_mutex = NULL;
    }

    if (movie->dest_overlay) {
        SDL_FreeYUVOverlay(movie->dest_overlay);
        movie->dest_overlay = NULL;
    }

    Global_num_active--;
}
开发者ID:Abstak,项目名称:Mastermind_Python,代码行数:34,代码来源:ffmovie.c

示例4: SDL_FreeSurface

EC_VOID SDL_VideoRender::Uninit()
{
    SDL_FreeSurface(m_pScreen);
    SDL_FreeYUVOverlay(m_pOverlay);
    SDL_QuitSubSystem(SDL_INIT_VIDEO);
    SDL_Quit();
}
开发者ID:brooksgod,项目名称:SuPlayer,代码行数:7,代码来源:SDL_VideoRender.cpp

示例5: do_video_options

int do_video_options(int sel) {
    int old_stretch = display_cfg.stretch;
#ifdef RAINE_WIN32
    UINT32 old_driver = display_cfg.video_driver;
#endif
    // int oldx = display_cfg.screen_x,oldy = display_cfg.screen_y;
    video_options = new TVideo(_("Video options"), video_items);
    video_options->execute();
#ifdef RAINE_WIN32
    if (old_driver != display_cfg.video_driver) {
	if (sdl_overlay) {
	    SDL_FreeYUVOverlay(sdl_overlay);
	    sdl_overlay = NULL;
	}
	sdl_screen = NULL;
	SDL_QuitSubSystem(SDL_INIT_VIDEO);
	setup_video_driver();
	SDL_InitSubSystem(SDL_INIT_VIDEO);
	ScreenChange();
    }
#endif
    SetupScreenBitmap();
    if ((sdl_overlay != NULL || display_cfg.video_mode == 1) &&
	    display_cfg.video_mode != 2) {
	// explicitely clear scanlines when overlays are enabled
	display_cfg.scanlines = 0;
    }
    if (old_stretch != display_cfg.stretch && display_cfg.stretch == 3 &&
	    sdl_game_bitmap) {
	DestroyScreenBitmap(); // init hq2x/3x, switch gamebitmap to 16bpp
	// + recall InitLUTs by recreating game_bitmap when enabling hq2x/3x
    }
    return 0; // (oldx != display_cfg.screen_x || oldy != display_cfg.screen_y);
}
开发者ID:albinoz,项目名称:raine,代码行数:34,代码来源:video_options.cpp

示例6: SDL_FreeYUVOverlay

uint8_t sdlAccelRender::end( void)
{
        if(sdl_overlay)
        {
                SDL_FreeYUVOverlay(sdl_overlay);
        }
        if(sdl_display)
        {
        		SDL_UnlockSurface(sdl_display);
                SDL_FreeSurface(sdl_display);
        }
        if(sdl_running)
        {
                SDL_QuitSubSystem(SDL_INIT_VIDEO);

#ifdef __APPLE__
				destroyCocoaView();
#endif
        }
        if(decoded)
        {
		        delete [] decoded;
		        decoded=NULL;	
        }
        sdl_running=0;
        sdl_overlay=NULL;
        sdl_display=NULL;
        printf("[SDL] Video subsystem closed and destroyed\n");        
}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:29,代码来源:GUI_sdlRender.cpp

示例7: SDL_FreeYUVOverlay

 ~SdlOverlayPort()
 {
     if (overlay_)
         SDL_FreeYUVOverlay(overlay_);
     if (sws_context_)
         sws_freeContext(sws_context_);
 }
开发者ID:tempbottle,项目名称:AVRemoteControl,代码行数:7,代码来源:sdloverlayport.hpp

示例8: SDL_FreeYUVOverlay

SdlAbstract::~SdlAbstract () {
    if (mpBmp) {
        SDL_FreeYUVOverlay(mpBmp);
        mpBmp = NULL;
    }
    SDL_Quit ();
}
开发者ID:brightmore,项目名称:AMP,代码行数:7,代码来源:sdl_abstract.cpp

示例9: overlay_dealloc

static void
overlay_dealloc (PyGameOverlay *self)
{
    if (SDL_WasInit (SDL_INIT_VIDEO) && self->cOverlay)
        SDL_FreeYUVOverlay (self->cOverlay);

    PyObject_Free ((PyObject*)self);
}
开发者ID:Mrhjx2,项目名称:pygame,代码行数:8,代码来源:overlay.c

示例10: sdlivr_proc_stop_and_return

static OMX_ERRORTYPE
sdlivr_proc_stop_and_return (void *ap_obj)
{
  sdlivr_prc_t *p_prc = ap_obj;
  assert (NULL != p_prc);
  SDL_FreeYUVOverlay (p_prc->p_overlay);
  return OMX_ErrorNone;
}
开发者ID:commshare,项目名称:tizonia-openmax-il,代码行数:8,代码来源:sdlivrprc.c

示例11: SDL_FreeYUVOverlay

ShowObject::~ShowObject(){
    SDL_FreeYUVOverlay(bmp);
    SDL_FreeSurface(screen);
    SDL_Quit();

    av_free(pFrame);
//    avcodec_close(pCodecCtx);
//    av_close_input_file(pFormatCtx);
}
开发者ID:ricann,项目名称:gwmonitor,代码行数:9,代码来源:display_func.cpp

示例12: SDL_UnlockYUVOverlay

SdlBlitter::~SdlBlitter() {
	if (overlay) {
		SDL_UnlockYUVOverlay(overlay);
		SDL_FreeYUVOverlay(overlay);
	}
	
	if (surface != screen)
		SDL_FreeSurface(surface);
}
开发者ID:CatalystG,项目名称:gambatte-libretro,代码行数:9,代码来源:sdlblitter.cpp

示例13: SDL_FreeYUVOverlay

/** Destructor. */
ImageDisplay::~ImageDisplay()
{
	delete _rect;

	SDL_FreeYUVOverlay(_overlay);
	SDL_FreeSurface(_surface);

	SDLKeeper::quit();
}
开发者ID:fawkesrobotics,项目名称:fawkes,代码行数:10,代码来源:image_display.cpp

示例14: main

int main(int argc, char** argv)
{
    int ret = EXIT_SUCCESS;

    /* Initialize param struct to zero */
    memset(&P, 0, sizeof(P));

    if (!parse_input(argc, argv)) {
        return EXIT_FAILURE;
    }

    /* Initialize parameters corresponding to YUV-format */
    setup_param();

    if (!sdl_init()) {
        return EXIT_FAILURE;
    }

    if (!open_input()) {
        return EXIT_FAILURE;
    }

    if (!allocate_memory()) {
        ret = EXIT_FAILURE;
        goto cleanup;
    }

    /* Lets do some basic consistency check on input */
    check_input();

    /* send event to display first frame */
    event.type = SDL_KEYDOWN;
    event.key.keysym.sym = SDLK_RIGHT;
    SDL_PushEvent(&event);

    /* while true */
    event_loop();

cleanup:
    destroy_message_queue();
    SDL_FreeYUVOverlay(my_overlay);
    free(P.raw);
    free(P.y_data);
    free(P.cb_data);
    free(P.cr_data);
    if (fd) {
        fclose(fd);
    }
    if (P.fd2) {
        fclose(P.fd2);
    }

    return ret;
}
开发者ID:figgis,项目名称:yuv-viewer,代码行数:54,代码来源:yv.c

示例15: vid_close

void vid_close()
{
	if (overlay)
	{
		SDL_UnlockYUVOverlay(overlay);
		SDL_FreeYUVOverlay(overlay);
	}
	else SDL_UnlockSurface(screen);
	SDL_Quit();
	fb.enabled = 0;
}
开发者ID:Garrant3,项目名称:gameboy4iphone,代码行数:11,代码来源:sdl.c


注:本文中的SDL_FreeYUVOverlay函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。