Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Side by Side Diff: content/renderer/pepper/video_decoder_shim.cc

Issue 2768713002: Pass a |media_log| to FFmpegVideoDecoder and roll ffmpeg (Closed)
Patch Set: Update cast sender unittest. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « DEPS ('k') | media/cast/sender/h264_vt_encoder_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/pepper/video_decoder_shim.h" 5 #include "content/renderer/pepper/video_decoder_shim.h"
6 6
7 #include <GLES2/gl2.h> 7 #include <GLES2/gl2.h>
8 #include <GLES2/gl2ext.h> 8 #include <GLES2/gl2ext.h>
9 #include <GLES2/gl2extchromium.h> 9 #include <GLES2/gl2extchromium.h>
10 #include <utility> 10 #include <utility>
11 11
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/location.h" 13 #include "base/location.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/memory/ref_counted.h"
16 #include "base/numerics/safe_conversions.h" 17 #include "base/numerics/safe_conversions.h"
17 #include "base/single_thread_task_runner.h" 18 #include "base/single_thread_task_runner.h"
18 #include "base/threading/thread_task_runner_handle.h" 19 #include "base/threading/thread_task_runner_handle.h"
19 #include "content/public/renderer/render_thread.h" 20 #include "content/public/renderer/render_thread.h"
20 #include "content/renderer/pepper/pepper_video_decoder_host.h" 21 #include "content/renderer/pepper/pepper_video_decoder_host.h"
21 #include "content/renderer/render_thread_impl.h" 22 #include "content/renderer/render_thread_impl.h"
22 #include "gpu/command_buffer/client/gles2_interface.h" 23 #include "gpu/command_buffer/client/gles2_interface.h"
23 #include "media/base/cdm_context.h" 24 #include "media/base/cdm_context.h"
24 #include "media/base/decoder_buffer.h" 25 #include "media/base/decoder_buffer.h"
25 #include "media/base/limits.h" 26 #include "media/base/limits.h"
27 #include "media/base/media_log.h"
26 #include "media/base/media_util.h" 28 #include "media/base/media_util.h"
27 #include "media/base/video_decoder.h" 29 #include "media/base/video_decoder.h"
28 #include "media/filters/ffmpeg_video_decoder.h" 30 #include "media/filters/ffmpeg_video_decoder.h"
29 #include "media/filters/vpx_video_decoder.h" 31 #include "media/filters/vpx_video_decoder.h"
30 #include "media/renderers/skcanvas_video_renderer.h" 32 #include "media/renderers/skcanvas_video_renderer.h"
31 #include "media/video/picture.h" 33 #include "media/video/picture.h"
32 #include "media/video/video_decode_accelerator.h" 34 #include "media/video/video_decode_accelerator.h"
33 #include "ppapi/c/pp_errors.h" 35 #include "ppapi/c/pp_errors.h"
34 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h" 36 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h"
35 #include "third_party/skia/include/gpu/GrTypes.h" 37 #include "third_party/skia/include/gpu/GrTypes.h"
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 DCHECK(!decoder_); 690 DCHECK(!decoder_);
689 #if !defined(MEDIA_DISABLE_LIBVPX) 691 #if !defined(MEDIA_DISABLE_LIBVPX)
690 if (config.codec() == media::kCodecVP9) { 692 if (config.codec() == media::kCodecVP9) {
691 decoder_.reset(new media::VpxVideoDecoder()); 693 decoder_.reset(new media::VpxVideoDecoder());
692 } else 694 } else
693 #endif 695 #endif
694 696
695 #if !defined(MEDIA_DISABLE_FFMPEG) && !defined(DISABLE_FFMPEG_VIDEO_DECODERS) 697 #if !defined(MEDIA_DISABLE_FFMPEG) && !defined(DISABLE_FFMPEG_VIDEO_DECODERS)
696 { 698 {
697 std::unique_ptr<media::FFmpegVideoDecoder> ffmpeg_video_decoder( 699 std::unique_ptr<media::FFmpegVideoDecoder> ffmpeg_video_decoder(
698 new media::FFmpegVideoDecoder()); 700 new media::FFmpegVideoDecoder(
701 make_scoped_refptr(new media::MediaLog())));
699 ffmpeg_video_decoder->set_decode_nalus(true); 702 ffmpeg_video_decoder->set_decode_nalus(true);
700 decoder_ = std::move(ffmpeg_video_decoder); 703 decoder_ = std::move(ffmpeg_video_decoder);
701 } 704 }
702 #elif defined(MEDIA_DISABLE_LIBVPX) 705 #elif defined(MEDIA_DISABLE_LIBVPX)
703 OnInitDone(false); 706 OnInitDone(false);
704 return; 707 return;
705 #endif 708 #endif
706 709
707 // VpxVideoDecoder and FFmpegVideoDecoder support only one pending Decode() 710 // VpxVideoDecoder and FFmpegVideoDecoder support only one pending Decode()
708 // request. 711 // request.
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 void VideoDecoderShim::DeleteTexture(uint32_t texture_id) { 1120 void VideoDecoderShim::DeleteTexture(uint32_t texture_id) {
1118 gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL(); 1121 gpu::gles2::GLES2Interface* gles2 = context_provider_->ContextGL();
1119 gles2->DeleteTextures(1, &texture_id); 1122 gles2->DeleteTextures(1, &texture_id);
1120 } 1123 }
1121 1124
1122 void VideoDecoderShim::FlushCommandBuffer() { 1125 void VideoDecoderShim::FlushCommandBuffer() {
1123 context_provider_->ContextGL()->Flush(); 1126 context_provider_->ContextGL()->Flush();
1124 } 1127 }
1125 1128
1126 } // namespace content 1129 } // namespace content
OLDNEW
« no previous file with comments | « DEPS ('k') | media/cast/sender/h264_vt_encoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698