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

Side by Side Diff: media/mojo/services/mojo_video_decoder_service.h

Issue 2096063003: media: Add MojoDecoderBuffer{Reader|Writer} (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 4 years, 6 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef MEDIA_MOJO_SERVICES_MOJO_VIDEO_DECODER_SERVICE_H_ 5 #ifndef MEDIA_MOJO_SERVICES_MOJO_VIDEO_DECODER_SERVICE_H_
6 #define MEDIA_MOJO_SERVICES_MOJO_VIDEO_DECODER_SERVICE_H_ 6 #define MEDIA_MOJO_SERVICES_MOJO_VIDEO_DECODER_SERVICE_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "media/base/decode_status.h" 12 #include "media/base/decode_status.h"
13 #include "media/mojo/interfaces/video_decoder.mojom.h" 13 #include "media/mojo/interfaces/video_decoder.mojom.h"
14 #include "mojo/public/cpp/bindings/strong_binding.h" 14 #include "mojo/public/cpp/bindings/strong_binding.h"
15 #include "mojo/public/cpp/system/data_pipe.h"
16 15
17 namespace media { 16 namespace media {
18 17
18 class MojoDecoderBufferReader;
19 class MojoMediaClient; 19 class MojoMediaClient;
20 class VideoDecoder; 20 class VideoDecoder;
21 class VideoFrame; 21 class VideoFrame;
22 22
23 // Implementation of a mojom::VideoDecoder which runs in the GPU process, 23 // Implementation of a mojom::VideoDecoder which runs in the GPU process,
24 // and wraps a media::VideoDecoder. 24 // and wraps a media::VideoDecoder.
25 class MojoVideoDecoderService : public mojom::VideoDecoder { 25 class MojoVideoDecoderService : public mojom::VideoDecoder {
26 public: 26 public:
27 MojoVideoDecoderService(mojo::InterfaceRequest<mojom::VideoDecoder> request, 27 MojoVideoDecoderService(mojo::InterfaceRequest<mojom::VideoDecoder> request,
28 MojoMediaClient* mojo_media_client); 28 MojoMediaClient* mojo_media_client);
(...skipping 10 matching lines...) Expand all
39 void Reset(const ResetCallback& callback) final; 39 void Reset(const ResetCallback& callback) final;
40 40
41 private: 41 private:
42 void OnDecoderInitialized(const InitializeCallback& callback, bool success); 42 void OnDecoderInitialized(const InitializeCallback& callback, bool success);
43 void OnDecoderDecoded(const DecodeCallback& callback, DecodeStatus status); 43 void OnDecoderDecoded(const DecodeCallback& callback, DecodeStatus status);
44 void OnDecoderOutput(const scoped_refptr<VideoFrame>& frame); 44 void OnDecoderOutput(const scoped_refptr<VideoFrame>& frame);
45 void OnDecoderReset(const ResetCallback& callback); 45 void OnDecoderReset(const ResetCallback& callback);
46 46
47 mojo::StrongBinding<mojom::VideoDecoder> binding_; 47 mojo::StrongBinding<mojom::VideoDecoder> binding_;
48 mojom::VideoDecoderClientPtr client_; 48 mojom::VideoDecoderClientPtr client_;
49 mojo::ScopedDataPipeConsumerHandle decoder_buffer_pipe_; 49 std::unique_ptr<MojoDecoderBufferReader> mojo_decoder_buffer_reader_;
50 50
51 MojoMediaClient* mojo_media_client_; 51 MojoMediaClient* mojo_media_client_;
52 std::unique_ptr<media::VideoDecoder> decoder_; 52 std::unique_ptr<media::VideoDecoder> decoder_;
53 53
54 base::WeakPtr<MojoVideoDecoderService> weak_this_; 54 base::WeakPtr<MojoVideoDecoderService> weak_this_;
55 base::WeakPtrFactory<MojoVideoDecoderService> weak_factory_; 55 base::WeakPtrFactory<MojoVideoDecoderService> weak_factory_;
56 56
57 DISALLOW_COPY_AND_ASSIGN(MojoVideoDecoderService); 57 DISALLOW_COPY_AND_ASSIGN(MojoVideoDecoderService);
58 }; 58 };
59 59
60 } // namespace media 60 } // namespace media
61 61
62 #endif // MEDIA_MOJO_SERVICES_MOJO_VIDEO_DECODER_SERVICE_H_ 62 #endif // MEDIA_MOJO_SERVICES_MOJO_VIDEO_DECODER_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698