VTB: release CVBuffer after it actually has been rendered
[xbmc.git] / xbmc / cores / FFmpeg.h
blobb7d25bfaeaee7350fa8a34ec5aaa48247b381987
1 #pragma once
3 /*
4 * Copyright (C) 2005-2013 Team XBMC
5 * http://xbmc.org
7 * This Program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
10 * any later version.
12 * This Program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with XBMC; see the file COPYING. If not, see
19 * <http://www.gnu.org/licenses/>.
24 #include "utils/CPUInfo.h"
26 extern "C" {
27 #include "libavcodec/avcodec.h"
28 #include "libavformat/avformat.h"
29 #include "libavutil/avutil.h"
30 #include "libavutil/ffversion.h"
31 #include "libavfilter/avfilter.h"
32 #include "libpostproc/postprocess.h"
35 inline int PPCPUFlags()
37 unsigned int cpuFeatures = g_cpuInfo.GetCPUFeatures();
38 int flags = 0;
40 if (cpuFeatures & CPU_FEATURE_MMX)
41 flags |= PP_CPU_CAPS_MMX;
42 if (cpuFeatures & CPU_FEATURE_MMX2)
43 flags |= PP_CPU_CAPS_MMX2;
44 if (cpuFeatures & CPU_FEATURE_3DNOW)
45 flags |= PP_CPU_CAPS_3DNOW;
46 if (cpuFeatures & CPU_FEATURE_ALTIVEC)
47 flags |= PP_CPU_CAPS_ALTIVEC;
49 return flags;
52 // callback used for locking
53 int ffmpeg_lockmgr_cb(void **mutex, enum AVLockOp operation);
55 // callback used for logging
56 void ff_avutil_log(void* ptr, int level, const char* format, va_list va);
57 void ff_flush_avutil_log_buffers(void);
59 class CFFmpegLog
61 public:
62 static void SetLogLevel(int level);
63 static int GetLogLevel();
64 static void ClearLogLevel();
65 int level;
68 #define FFMPEG_FILE_BUFFER_SIZE 32768 // default reading size for ffmpeg