base/threading: remove ScopedTracker placed for experiments
[chromium-blink-merge.git] / remoting / codec / video_decoder_vpx.h
blob21a576a8f9ee594594b9f660560803553b8b3b55
1 // Copyright 2013 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.
5 #ifndef REMOTING_CODEC_VIDEO_DECODER_VPX_H_
6 #define REMOTING_CODEC_VIDEO_DECODER_VPX_H_
8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "remoting/codec/scoped_vpx_codec.h"
11 #include "remoting/codec/video_decoder.h"
12 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
13 #include "third_party/webrtc/modules/desktop_capture/desktop_region.h"
15 typedef const struct vpx_codec_iface vpx_codec_iface_t;
16 typedef struct vpx_image vpx_image_t;
18 namespace remoting {
20 class VideoDecoderVpx : public VideoDecoder {
21 public:
22 // Create decoders for the specified protocol.
23 static scoped_ptr<VideoDecoderVpx> CreateForVP8();
24 static scoped_ptr<VideoDecoderVpx> CreateForVP9();
26 ~VideoDecoderVpx() override;
28 // VideoDecoder interface.
29 void Initialize(const webrtc::DesktopSize& source_size) override;
30 bool DecodePacket(const VideoPacket& packet) override;
31 void Invalidate(const webrtc::DesktopSize& view_size,
32 const webrtc::DesktopRegion& region) override;
33 void RenderFrame(const webrtc::DesktopSize& view_size,
34 const webrtc::DesktopRect& clip_area,
35 uint8* image_buffer,
36 int image_stride,
37 webrtc::DesktopRegion* output_region) override;
38 const webrtc::DesktopRegion* GetImageShape() override;
40 private:
41 explicit VideoDecoderVpx(vpx_codec_iface_t* codec);
43 // Returns the dimensions of the most recent frame as a DesktopSize.
44 webrtc::DesktopSize image_size() const;
46 ScopedVpxCodec codec_;
48 // Pointer to the most recently decoded image.
49 vpx_image_t* image_;
51 // Area of the source that has changed since the last RenderFrame call.
52 webrtc::DesktopRegion updated_region_;
54 // The shape of the most-recent frame, if any.
55 scoped_ptr<webrtc::DesktopRegion> desktop_shape_;
57 DISALLOW_COPY_AND_ASSIGN(VideoDecoderVpx);
60 } // namespace remoting
62 #endif // REMOTING_CODEC_VIDEO_DECODER_VP8_H_