summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-01 16:50:04 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-01 16:50:04 +0000
commit4b48b1d44ef365c3f3e7f776552265fc8d1a1b07 (patch)
treed4d68e79b593a82487b1bb881a4f7c27ac9dbd75 /media
parent2f52e870b77b89b0876b58555f7f7e3d641560d0 (diff)
downloadchromium_src-4b48b1d44ef365c3f3e7f776552265fc8d1a1b07.zip
chromium_src-4b48b1d44ef365c3f3e7f776552265fc8d1a1b07.tar.gz
chromium_src-4b48b1d44ef365c3f3e7f776552265fc8d1a1b07.tar.bz2
Fix some style issues in media/video/ffmpeg_video_allocator.{cc,h}.
BUG=none TEST=none Review URL: http://codereview.chromium.org/6771037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80174 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r--media/video/ffmpeg_video_allocator.cc18
-rw-r--r--media/video/ffmpeg_video_allocator.h12
2 files changed, 16 insertions, 14 deletions
diff --git a/media/video/ffmpeg_video_allocator.cc b/media/video/ffmpeg_video_allocator.cc
index 62ecade..f51337d 100644
--- a/media/video/ffmpeg_video_allocator.cc
+++ b/media/video/ffmpeg_video_allocator.cc
@@ -26,7 +26,7 @@ FFmpegVideoAllocator::~FFmpegVideoAllocator() {}
void FFmpegVideoAllocator::Initialize(AVCodecContext* codec_context,
VideoFrame::Format surface_format) {
-#ifdef FF_THREAD_FRAME // Only defined in FFMPEG-MT.
+#if defined(FF_THREAD_FRAME) // Only defined in FFMPEG-MT.
surface_format_ = surface_format;
get_buffer_ = codec_context->get_buffer;
release_buffer_ = codec_context->release_buffer;
@@ -37,7 +37,7 @@ void FFmpegVideoAllocator::Initialize(AVCodecContext* codec_context,
}
void FFmpegVideoAllocator::Stop(AVCodecContext* codec_context) {
-#ifdef FF_THREAD_FRAME // Only defined in FFMPEG-MT.
+#if defined(FF_THREAD_FRAME) // Only defined in FFMPEG-MT.
// Restore default buffer allocator functions.
// This does not work actually, because in ffmpeg-mt, there are
// multiple codec_context copies per threads. each context maintain
@@ -64,7 +64,7 @@ void FFmpegVideoAllocator::Stop(AVCodecContext* codec_context) {
void FFmpegVideoAllocator::DisplayDone(
AVCodecContext* codec_context,
scoped_refptr<VideoFrame> video_frame) {
-#ifdef FF_THREAD_FRAME // Only defined in FFMPEG-MT.
+#if defined(FF_THREAD_FRAME) // Only defined in FFMPEG-MT.
RefCountedAVFrame* ffmpeg_video_frame =
reinterpret_cast<RefCountedAVFrame*>(video_frame->private_buffer());
if (ffmpeg_video_frame->Release() == 0) {
@@ -78,7 +78,7 @@ scoped_refptr<VideoFrame> FFmpegVideoAllocator::DecodeDone(
AVCodecContext* codec_context,
AVFrame* av_frame) {
scoped_refptr<VideoFrame> frame;
-#ifdef FF_THREAD_FRAME // Only defined in FFMPEG-MT.
+#if defined(FF_THREAD_FRAME) // Only defined in FFMPEG-MT.
RefCountedAVFrame* ffmpeg_video_frame =
reinterpret_cast<RefCountedAVFrame*>(av_frame->opaque);
ffmpeg_video_frame->av_frame_ = *av_frame;
@@ -98,14 +98,14 @@ scoped_refptr<VideoFrame> FFmpegVideoAllocator::DecodeDone(
}
int FFmpegVideoAllocator::AllocateBuffer(AVCodecContext* codec_context,
- AVFrame* av_frame) {
+ AVFrame* av_frame) {
FFmpegVideoAllocator* context =
reinterpret_cast<FFmpegVideoAllocator*>(codec_context->opaque);
return context->InternalAllocateBuffer(codec_context, av_frame);
}
void FFmpegVideoAllocator::ReleaseBuffer(AVCodecContext* codec_context,
- AVFrame* av_frame) {
+ AVFrame* av_frame) {
FFmpegVideoAllocator* context =
reinterpret_cast<FFmpegVideoAllocator*>(codec_context->opaque);
context->InternalReleaseBuffer(codec_context, av_frame);
@@ -113,7 +113,7 @@ void FFmpegVideoAllocator::ReleaseBuffer(AVCodecContext* codec_context,
int FFmpegVideoAllocator::InternalAllocateBuffer(
AVCodecContext* codec_context, AVFrame* av_frame) {
-#ifdef FF_THREAD_FRAME // Only defined in FFMPEG-MT.
+#if defined(FF_THREAD_FRAME) // Only defined in FFMPEG-MT.
// If |codec_context| is not yet known to us, we add it to our map.
if (codec_index_map_.find(codec_context) == codec_index_map_.end()) {
int next_index = codec_index_map_.size();
@@ -149,7 +149,7 @@ int FFmpegVideoAllocator::InternalAllocateBuffer(
void FFmpegVideoAllocator::InternalReleaseBuffer(
AVCodecContext* codec_context, AVFrame* av_frame) {
-#ifdef FF_THREAD_FRAME // Only defined in FFMPEG-MT.
+#if defined(FF_THREAD_FRAME) // Only defined in FFMPEG-MT.
if (av_frame->opaque == NULL) {
// This could happened in two scenario:
// 1. FFMPEG-MT H264 codec seems to allocate one frame during
@@ -174,7 +174,7 @@ void FFmpegVideoAllocator::InternalReleaseBuffer(
available_frames_[index].push_back(ffmpeg_video_frame);
for (int k = 0; k < 4; ++k)
- av_frame->data[k]=NULL;
+ av_frame->data[k] = NULL;
#endif
}
diff --git a/media/video/ffmpeg_video_allocator.h b/media/video/ffmpeg_video_allocator.h
index 5e54925..d70f019 100644
--- a/media/video/ffmpeg_video_allocator.h
+++ b/media/video/ffmpeg_video_allocator.h
@@ -85,13 +85,15 @@ class FFmpegVideoAllocator {
// This map is used to map from AVCodecContext* to index to
// |available_frames_|, because ffmpeg-mt maintain multiple
// AVCodecContext (per thread).
- std::map<void*, int> codec_index_map_;
+ std::map<AVCodecContext*, int> codec_index_map_;
- // These function pointer store original ffmpeg AVCodecContext's
- // get_buffer()/release_buffer() function pointer. We use these function
+ // These function pointers store the original AVCodecContext's
+ // get_buffer()/release_buffer() function pointers. We use these functions
// to delegate the allocation request.
- int (*get_buffer_)(struct AVCodecContext *c, AVFrame *pic);
- void (*release_buffer_)(struct AVCodecContext *c, AVFrame *pic);
+ int (*get_buffer_)(AVCodecContext* c, AVFrame* pic);
+ void (*release_buffer_)(AVCodecContext* c, AVFrame* pic);
+
+ DISALLOW_COPY_AND_ASSIGN(FFmpegVideoAllocator);
};
} // namespace media