OLD | NEW |
1 This tool decodes a H.264 format video into YV12 frames and draws them onto | 1 This tool decodes a H.264 format video into YV12 frames and draws them onto |
2 a window. | 2 a window. |
3 | 3 |
4 The program uses Media Foundation to do much of the work. Specifically, it | 4 The program uses Media Foundation to do much of the work. Specifically, it |
5 uses the Source Reader (IMFSourceReader) to read from a file and the built-in | 5 uses the Source Reader (IMFSourceReader) to read from a file and the built-in |
6 H.264 decoder (as an IMFTransform) to decode the video file into YV12 frames. | 6 H.264 decoder (as an IMFTransform) to decode the video file into YV12 frames. |
7 The decoding can be done with or without hardware acceleration. | 7 The decoding can be done with or without hardware acceleration. |
8 | 8 |
9 If decoding is done without hardware acceleration, then the YV12 frames are | 9 If decoding is done without hardware acceleration, then the YV12 frames are |
10 converted into RGB using ConvertYUVToRGB32() provided in | 10 converted into RGB using ConvertYUVToRGB32() provided in |
11 media/base/yuv_convert.h. They are then drawn to a window using StretchDIBits() | 11 media/base/yuv_convert.h. They are then drawn to a window using StretchDIBits() |
12 provided in gfx/gdi_util.h. | 12 provided in ui/gfx/gdi_util.h. |
13 | 13 |
14 If decoding is done with hardware acceleration, then the frames are obtained | 14 If decoding is done with hardware acceleration, then the frames are obtained |
15 from a D3D surface (IDirect3DSurface9). It is then drawn through calling | 15 from a D3D surface (IDirect3DSurface9). It is then drawn through calling |
16 methods of a D3D device (IDirect3DDevice9) that is associated with the | 16 methods of a D3D device (IDirect3DDevice9) that is associated with the |
17 video window that we created during initialization. | 17 video window that we created during initialization. |
18 | 18 |
19 The painting is done using a MessageLoop that posts paint tasks every 30ms | 19 The painting is done using a MessageLoop that posts paint tasks every 30ms |
20 until the end of stream is reached. Thus the painting part acts like a | 20 until the end of stream is reached. Thus the painting part acts like a |
21 playback. | 21 playback. |
22 | 22 |
(...skipping 13 matching lines...) Expand all Loading... |
36 flags: | 36 flags: |
37 -s: Use software decoding | 37 -s: Use software decoding |
38 -h: Uses hardware decoding | 38 -h: Uses hardware decoding |
39 | 39 |
40 -d: Decode to YV12 as fast as possible, no rendering or color-space conversion | 40 -d: Decode to YV12 as fast as possible, no rendering or color-space conversion |
41 -r: Render to window | 41 -r: Render to window |
42 -f: Decode+render as fast as possible | 42 -f: Decode+render as fast as possible |
43 | 43 |
44 WARNING: Using both -h and -f, or opening too many windows with -h may lead to | 44 WARNING: Using both -h and -f, or opening too many windows with -h may lead to |
45 driver crash / system instability. Realistically, you will never want to | 45 driver crash / system instability. Realistically, you will never want to |
46 do this unless you want to push the limits of the GPU ... | 46 do this unless you want to push the limits of the GPU ... |
OLD | NEW |