Skip to content

Commit

Permalink
use to gdi render
Browse files Browse the repository at this point in the history
Signed-off-by: Jack <[email protected]>
  • Loading branch information
Jackarain committed Jan 30, 2013
1 parent b2555ed commit a6a8e91
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion win32/avcore/avplayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
#define RENDER_DDRAW 0
#define RENDER_D3D 1
#define RENDER_OGL 2
#define RENDER_Y4M 3
#define RENDER_SOFT 3
#define RENDER_Y4M 4

class player_impl;
// avplayer封装类.
Expand Down
20 changes: 20 additions & 0 deletions win32/avcore/player_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,26 @@ void player_impl::init_video(vo_context *vo, int render_type/* = RENDER_D3D*/)
}
}

if (render_type == RENDER_SOFT || check == -1)
{
ret = gdi_init_video((void*)vo, 10, 10, PIX_FMT_YUV420P);
gdi_destory_render(vo);
if (ret == 0)
{
vo->init_video = gdi_init_video;
m_draw_frame = gdi_render_one_frame;
vo->re_size = gdi_re_size;
vo->aspect_ratio = gdi_aspect_ratio;
vo->use_overlay = gdi_use_overlay;
vo->destory_video = gdi_destory_render;
vo->render_one_frame = &player_impl::draw_frame;

::logger("init video render to gdi.\n");

break;
}
}

} while (check-- == 0);

// 表示视频渲染器初始化失败!!!
Expand Down

0 comments on commit a6a8e91

Please sign in to comment.