00001 /* 00002 * Copyright (C) 2003 Ivan Kalvachev 00003 * 00004 * This file is part of FFmpeg. 00005 * 00006 * FFmpeg is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2.1 of the License, or (at your option) any later version. 00010 * 00011 * FFmpeg is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public 00017 * License along with FFmpeg; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00019 */ 00020 00021 #ifndef FFMPEG_XVMC_RENDER_H 00022 #define FFMPEG_XVMC_RENDER_H 00023 00024 #include <X11/Xlib.h> 00025 #include <X11/Xutil.h> 00026 #include <X11/Xatom.h> 00027 #include <X11/extensions/Xv.h> 00028 #include <X11/extensions/Xvlib.h> 00029 #include <X11/extensions/XvMClib.h> 00030 00031 00032 //the surface should be shown, video driver manipulates this 00033 #define MP_XVMC_STATE_DISPLAY_PENDING 1 00034 //the surface is needed for prediction, codec manipulates this 00035 #define MP_XVMC_STATE_PREDICTION 2 00036 //this surface is needed for subpicture rendering 00037 #define MP_XVMC_STATE_OSD_SOURCE 4 00038 // 1337 IDCT MCo 00039 #define MP_XVMC_RENDER_MAGIC 0x1DC711C0 00040 00041 typedef struct{ 00042 //these are not changed by the decoder! 00043 int magic; 00044 00045 short * data_blocks; 00046 XvMCMacroBlock * mv_blocks; 00047 int total_number_of_mv_blocks; 00048 int total_number_of_data_blocks; 00049 int mc_type;//XVMC_MPEG1/2/4,XVMC_H263 without XVMC_IDCT 00050 int idct;//Do we use IDCT acceleration? 00051 int chroma_format;//420,422,444 00052 int unsigned_intra;//+-128 for intra pictures after clip 00053 XvMCSurface* p_surface;//pointer to rendered surface, never changed 00054 00055 //these are changed by decoder 00056 //used by XvMCRenderSurface function 00057 XvMCSurface* p_past_surface;//pointer to the past surface 00058 XvMCSurface* p_future_surface;//pointer to the future prediction surface 00059 00060 unsigned int picture_structure;//top/bottom fields or frame! 00061 unsigned int flags;//XVMC_SECOND_FIELD - 1'st or 2'd field in the sequence 00062 unsigned int display_flags; //1,2 or 1+2 fields for XvMCPutSurface, 00063 00064 //these are internal communication ones 00065 int state;//0-free, 1 Waiting to Display, 2 Waiting for prediction 00066 int start_mv_blocks_num;//offset in the array for the current slice, updated by vo 00067 int filled_mv_blocks_num;//processed mv block in this slice, changed by decoder 00068 00069 int next_free_data_block_num;//used in add_mv_block, pointer to next free block 00070 //extensions 00071 void * p_osd_target_surface_render;//pointer to the surface where subpicture is rendered 00072 00073 } xvmc_render_state_t; 00074 00075 #endif /* FFMPEG_XVMC_RENDER_H */