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

Side by Side Diff: media/remoting/end2end_test_renderer.h

Issue 2808583002: RELAND: Media Remoting end to end integration tests. (Closed)
Patch Set: Rebased. Created 3 years, 8 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 | « media/remoting/BUILD.gn ('k') | media/remoting/end2end_test_renderer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 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 #ifndef MEDIA_REMOTING_END2END_RENDERER_H_
6 #define MEDIA_REMOTING_END2END_RENDERER_H_
7
8 #include <vector>
9
10 #include "base/memory/weak_ptr.h"
11 #include "media/base/demuxer_stream.h"
12 #include "media/base/renderer.h"
13 #include "media/remoting/rpc_broker.h"
14
15 namespace media {
16 namespace remoting {
17
18 class SharedSession;
19 class RendererController;
20 class CourierRenderer;
21 class Receiver;
22
23 // Simulates the media remoting pipeline.
24 class End2EndTestRenderer final : public Renderer {
25 public:
26 explicit End2EndTestRenderer(std::unique_ptr<Renderer> renderer);
27 ~End2EndTestRenderer() override;
28
29 // Renderer implementation.
30 void Initialize(MediaResource* media_resource,
31 RendererClient* client,
32 const PipelineStatusCB& init_cb) override;
33 void SetCdm(CdmContext* cdm_context,
34 const CdmAttachedCB& cdm_attached_cb) override;
35 void Flush(const base::Closure& flush_cb) override;
36 void StartPlayingFrom(base::TimeDelta time) override;
37 void SetPlaybackRate(double playback_rate) override;
38 void SetVolume(float volume) override;
39 base::TimeDelta GetMediaTime() override;
40
41 private:
42 // Called to send RPC messages to |receiver_|.
43 void SendMessageToSink(const std::vector<uint8_t>& message);
44
45 // Called to send frame data to |receiver_|.
46 void SendFrameToSink(const std::vector<uint8_t>& data,
47 DemuxerStream::Type type);
48
49 // Called when receives RPC messages from |receiver_|.
50 void OnMessageFromSink(std::unique_ptr<std::vector<uint8_t>> message);
51
52 // The session that is used by |controller_| to create the data pipes.
53 scoped_refptr<SharedSession> shared_session_;
54 std::unique_ptr<RendererController> controller_;
55 std::unique_ptr<CourierRenderer> courier_renderer_;
56
57 // The RpcBroker to handle the RPC messages to/from |receiver_|.
58 RpcBroker receiver_rpc_broker_;
59
60 // A receiver that renders media streams.
61 std::unique_ptr<Receiver> receiver_;
62
63 base::WeakPtrFactory<End2EndTestRenderer> weak_factory_;
64
65 DISALLOW_COPY_AND_ASSIGN(End2EndTestRenderer);
66 };
67
68 } // namespace remoting
69 } // namespace media
70
71 #endif // MEDIA_REMOTING_END2END_RENDERER_H_
OLDNEW
« no previous file with comments | « media/remoting/BUILD.gn ('k') | media/remoting/end2end_test_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698