core/vidl/vidl_ffmpeg_convert.h
Go to the documentation of this file.
00001 // This is core/vidl/vidl_ffmpeg_convert.h
00002 #ifndef vidl_ffmpeg_convert_h_
00003 #define vidl_ffmpeg_convert_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \brief Use FFMPEG for optimized pixel format conversions
00010 //
00011 // \author Matt Leotta
00012 // \date 19 Jan 2006
00013 //
00014 
00015 #include "vidl_frame_sptr.h"
00016 #include "vidl_pixel_format.h"
00017 
00018 #include <vidl/vidl_config.h>
00019 extern "C" {
00020 #if FFMPEG_IN_SEVERAL_DIRECTORIES
00021 #ifndef __STDC_CONSTANT_MACROS
00022 #  define __STDC_CONSTANT_MACROS
00023 #endif
00024 #include <libavcodec/avcodec.h>
00025 #else
00026 #include <ffmpeg/avcodec.h>
00027 #endif
00028 }
00029 
00030 //: Convert the pixel format of a frame using FFMPEG
00031 //
00032 // The \p in_frame->data() is converted from \p in_frame->pixel_format()
00033 // to \p out_frame->pixel_format() and stored in \p out_frame->data()
00034 // If the output frame data is not the correct size new memory
00035 // will be allocated
00036 bool vidl_ffmpeg_convert(const vidl_frame_sptr& in_frame,
00037                                vidl_frame_sptr& out_frame);
00038 
00039 
00040 //: Find the vidl pixel format that matches a FFMPEG one
00041 vidl_pixel_format
00042 vidl_pixel_format_from_ffmpeg(PixelFormat ffmpeg_pix_fmt);
00043 
00044 
00045 //: Find the FFMPEG pixel format that matches a vidl one
00046 PixelFormat
00047 vidl_pixel_format_to_ffmpeg(vidl_pixel_format vidl_pix_fmt);
00048 
00049 #endif // vidl_ffmpeg_convert_h_
00050