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

Side by Side Diff: extensions/renderer/api/display_source/wifi_display/wifi_display_media_manager.h

Issue 1783843002: [chrome.displaySource][WiFi Display] Video formats capability negotiation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@export_video_format
Patch Set: Style fixes Created 4 years, 9 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 | « no previous file | extensions/renderer/api/display_source/wifi_display/wifi_display_media_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 EXTENSIONS_BROWSER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_MEDIA_MA NAGER_H_ 5 #ifndef EXTENSIONS_BROWSER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_MEDIA_MA NAGER_H_
6 #define EXTENSIONS_BROWSER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_MEDIA_MA NAGER_H_ 6 #define EXTENSIONS_BROWSER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_MEDIA_MA NAGER_H_
7 7
8 #include <string>
9 #include <utility>
10 #include <vector>
11
12 #include "base/callback.h"
8 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "third_party/WebKit/public/web/WebDOMMediaStreamTrack.h"
9 #include "third_party/wds/src/libwds/public/media_manager.h" 15 #include "third_party/wds/src/libwds/public/media_manager.h"
10 16
11 namespace extensions { 17 namespace extensions {
12 18
13 class WiFiDisplayMediaManager : public wds::SourceMediaManager { 19 class WiFiDisplayMediaManager : public wds::SourceMediaManager {
14 public: 20 public:
15 WiFiDisplayMediaManager(); 21 using ErrorCallback = base::Callback<void(const std::string&)>;
22
23 WiFiDisplayMediaManager(
24 const blink::WebMediaStreamTrack& video_track,
25 const blink::WebMediaStreamTrack& audio_track,
26 const ErrorCallback& error_callback);
27
16 ~WiFiDisplayMediaManager() override; 28 ~WiFiDisplayMediaManager() override;
17 29
18 private: 30 private:
19 // wds::SourceMediaManager overrides. 31 // wds::SourceMediaManager overrides.
20 void Play() override; 32 void Play() override;
21 33
22 void Pause() override; 34 void Pause() override;
23 void Teardown() override; 35 void Teardown() override;
24 bool IsPaused() const override; 36 bool IsPaused() const override;
25 wds::SessionType GetSessionType() const override; 37 wds::SessionType GetSessionType() const override;
26 void SetSinkRtpPorts(int port1, int port2) override; 38 void SetSinkRtpPorts(int port1, int port2) override;
27 std::pair<int,int> GetSinkRtpPorts() const override; 39 std::pair<int, int> GetSinkRtpPorts() const override;
28 int GetLocalRtpPort() const override; 40 int GetLocalRtpPort() const override;
29 41
30 bool InitOptimalVideoFormat( 42 bool InitOptimalVideoFormat(
31 const wds::NativeVideoFormat& sink_native_format, 43 const wds::NativeVideoFormat& sink_native_format,
32 const std::vector<wds::H264VideoCodec>& sink_supported_codecs) override; 44 const std::vector<wds::H264VideoCodec>& sink_supported_codecs) override;
33 wds::H264VideoFormat GetOptimalVideoFormat() const override; 45 wds::H264VideoFormat GetOptimalVideoFormat() const override;
34 bool InitOptimalAudioFormat( 46 bool InitOptimalAudioFormat(
35 const std::vector<wds::AudioCodec>& sink_supported_codecs) override; 47 const std::vector<wds::AudioCodec>& sink_supported_codecs) override;
36 wds::AudioCodec GetOptimalAudioFormat() const override; 48 wds::AudioCodec GetOptimalAudioFormat() const override;
37 49
38 void SendIDRPicture() override; 50 void SendIDRPicture() override;
39 51
40 std::string GetSessionId() const override; 52 std::string GetSessionId() const override;
41 53
54 private:
55 blink::WebMediaStreamTrack video_track_;
56 blink::WebMediaStreamTrack audio_track_;
57
58 std::pair<int, int> sink_rtp_ports_;
59 wds::H264VideoFormat optimal_video_format_;
60
61 ErrorCallback error_callback_;
62
42 DISALLOW_COPY_AND_ASSIGN(WiFiDisplayMediaManager); 63 DISALLOW_COPY_AND_ASSIGN(WiFiDisplayMediaManager);
43 }; 64 };
44 65
45 } // namespace extensions 66 } // namespace extensions
46 67
47 #endif // EXTENSIONS_BROWSER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_MEDIA _MANAGER_H_ 68 #endif // EXTENSIONS_BROWSER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_MEDIA _MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | extensions/renderer/api/display_source/wifi_display/wifi_display_media_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698