[go: nahoru, domu]

media/gpu/AVD: Take DecoderBuffer in AVD::SetStream()'s argument

This changes AcceleratedVideoDecoder::SetStream() argument to DecoderBuffer.
DecoderBuffer has any required information to decode. It may have additional
info that is specifically necessary in AcceleratedVideoDecoder. For instance, it
has frame sizes of spatial layers in VP9 SVC stream aside from bitstream data.
This is a second step to enable VP9 k-SVC decoding with HW decoder on chromeos
intel platform.

Design doc for this change is go/VP9-k-SVC-Decoing-VAAPI.

Bug: chromium:935411
Test: media_unittests
Test: Hangout Meet with VP9 SVC stream
Change-Id: I45ca9e6ea7e7c6b8ac619495049be51fa9aed486
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1686981
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Ted Meyer <tmathmeyer@chromium.org>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#675637}
diff --git a/media/gpu/vp9_decoder.cc b/media/gpu/vp9_decoder.cc
index 6cb9071..4927308 100644
--- a/media/gpu/vp9_decoder.cc
+++ b/media/gpu/vp9_decoder.cc
@@ -27,10 +27,11 @@
 
 VP9Decoder::~VP9Decoder() = default;
 
-void VP9Decoder::SetStream(int32_t id,
-                           const uint8_t* ptr,
-                           size_t size,
-                           const DecryptConfig* decrypt_config) {
+void VP9Decoder::SetStream(int32_t id, const DecoderBuffer& decoder_buffer) {
+  const uint8_t* ptr = decoder_buffer.data();
+  const size_t size = decoder_buffer.data_size();
+  const DecryptConfig* decrypt_config = decoder_buffer.decrypt_config();
+
   DCHECK(ptr);
   DCHECK(size);
   DVLOG(4) << "New input stream id: " << id << " at: " << (void*)ptr