1 // Copyright 2018 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "media/gpu/windows/d3d11_vp9_picture.h"
6 
7 namespace media {
8 
D3D11VP9Picture(D3D11PictureBuffer * picture_buffer,D3D11VideoDecoderClient * client)9 D3D11VP9Picture::D3D11VP9Picture(D3D11PictureBuffer* picture_buffer,
10                                  D3D11VideoDecoderClient* client)
11     : picture_buffer_(picture_buffer),
12       client_(client),
13       picture_index_(picture_buffer_->picture_index()) {
14   picture_buffer_->set_in_picture_use(true);
15 }
16 
~D3D11VP9Picture()17 D3D11VP9Picture::~D3D11VP9Picture() {
18   picture_buffer_->set_in_picture_use(false);
19 }
20 
CreateDuplicate()21 scoped_refptr<VP9Picture> D3D11VP9Picture::CreateDuplicate() {
22   // We've already sent off the base frame for rendering, so we can just stamp
23   // |picture_buffer_| with the updated timestamp.
24   client_->UpdateTimestamp(picture_buffer_);
25   return this;
26 }
27 
28 }  // namespace media
29