OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MEDIA_REMOTING_RPC_RPC_H_ | |
6 #define MEDIA_REMOTING_RPC_RPC_H_ | |
7 | |
8 #include <cstdint> | |
9 #include <string> | |
10 #include <vector> | |
11 | |
12 #include "base/macros.h" | |
13 #include "base/memory/ref_counted.h" | |
14 #include "media/base/audio_decoder_config.h" | |
15 #include "media/base/cdm_config.h" | |
16 #include "media/base/cdm_key_information.h" | |
17 #include "media/base/demuxer_stream.h" | |
18 #include "media/base/eme_constants.h" | |
19 #include "media/base/media_keys.h" | |
20 #include "media/base/pipeline_status.h" | |
21 #include "media/base/video_decoder_config.h" | |
22 #include "media/remoting/remoting_rpc_message.pb.h" | |
23 | |
24 namespace media { | |
25 namespace remoting { | |
26 | |
27 class CdmPromiseResult; | |
28 | |
29 extern const int kInvalidHandle; | |
miu
2016/09/13 05:40:58
These don't seem to be used anywhere. Are you plan
erickung1
2016/09/15 02:13:33
I updated the code to use kReceiverHandle when RPC
| |
30 extern const int kReceiverHandle; | |
31 | |
32 void SerializeEncryptionScheme( | |
miu
2016/09/13 05:40:58
General comment for these Serialize/Deserialize fu
erickung1
2016/09/15 02:13:33
I made the change for #1 #2 and most #3.
When you
miu
2016/09/16 18:14:13
Normal route. General guideline: If a value is not
| |
33 pb::EncryptionScheme* message, | |
34 const ::media::EncryptionScheme& encryption_scheme); | |
35 void DeserializeEncryptionScheme(const pb::EncryptionScheme& message, | |
36 ::media::EncryptionScheme* encryption_scheme); | |
37 | |
38 void SerializeAudioConfig(const ::media::AudioDecoderConfig& audio_config, | |
39 pb::AudioDecoderConfig* audio_message); | |
40 bool DeserializeAudioConfig(const pb::AudioDecoderConfig& audio_message, | |
41 ::media::AudioDecoderConfig* audio_config); | |
42 | |
43 void SerializeVideoConfig(const ::media::VideoDecoderConfig& video_config, | |
44 pb::VideoDecoderConfig* video_message); | |
45 bool DeserializeVideoConfig(const pb::VideoDecoderConfig& video_message, | |
46 ::media::VideoDecoderConfig* video_config); | |
47 | |
48 void SerializeCdmConfig(const ::media::CdmConfig& cdm_config, | |
49 pb::CdmInitialize* message); | |
50 | |
51 void SerializeCdmPromiseResult(pb::CdmPromise* promise_message, | |
52 const CdmPromiseResult& result); | |
53 bool DeserializeCdmPromiseResult(const pb::CdmPromise& promise_message, | |
54 CdmPromiseResult* result); | |
55 | |
56 void SerializeCdmKeyInformation( | |
57 const ::media::CdmKeysInfo& keys_information, | |
58 pb::CdmClientOnSessionKeysChange* key_change_message); | |
59 bool DeserializeCdmKeyInformation( | |
60 const pb::CdmClientOnSessionKeysChange keychange_message, | |
61 CdmKeysInfo* key_information); | |
62 | |
63 bool CdmPromiseFromMessage(const pb::RpcMessage& message, | |
64 CdmPromiseResult* result, | |
65 int* cdm_id, | |
66 std::string* session_id); | |
67 void CdmPromiseToMessage(pb::CdmPromise* promise_message, | |
68 const CdmPromiseResult& result, | |
69 const std::string& session_id); | |
70 void CdmPromiseWithCdmIdToMessage(pb::CdmPromise* promise_message, | |
71 const CdmPromiseResult& result, | |
72 int cdm_id); | |
73 | |
74 //================================================================== | |
75 class CdmPromiseResult { | |
76 public: | |
77 CdmPromiseResult(); | |
78 CdmPromiseResult(::media::MediaKeys::Exception exception, | |
79 uint32_t system_code, | |
80 std::string error_message); | |
81 CdmPromiseResult(const CdmPromiseResult& other); | |
82 ~CdmPromiseResult(); | |
83 | |
84 static CdmPromiseResult SuccessResult(); | |
85 | |
86 bool success() const { return success_; } | |
87 ::media::MediaKeys::Exception exception() const { return exception_; } | |
88 uint32_t system_code() const { return system_code_; } | |
89 const std::string& error_message() const { return error_message_; } | |
90 | |
91 private: | |
92 bool success_; | |
93 ::media::MediaKeys::Exception exception_; | |
94 uint32_t system_code_; | |
95 std::string error_message_; | |
96 }; | |
97 | |
98 } // namespace remoting | |
99 } // namespace media | |
100 | |
101 #endif // MEDIA_REMOTING_RPC_RPC_H_ | |
OLD | NEW |