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

Unified Diff: content/browser/media/capture/audio_mirroring_manager.h

Issue 1897953003: Unmute Tab Audio For Desktop Share (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix trybot error Created 4 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/media/capture/audio_mirroring_manager.h
diff --git a/content/browser/media/capture/audio_mirroring_manager.h b/content/browser/media/capture/audio_mirroring_manager.h
index a624a0824befa013d4868d12a3c75f50ac8417f6..819a372f71b2fce2b5a89f84674c8d72925ee2b0 100644
--- a/content/browser/media/capture/audio_mirroring_manager.h
+++ b/content/browser/media/capture/audio_mirroring_manager.h
@@ -32,6 +32,7 @@
#ifndef CONTENT_BROWSER_MEDIA_CAPTURE_AUDIO_MIRRORING_MANAGER_H_
#define CONTENT_BROWSER_MEDIA_CAPTURE_AUDIO_MIRRORING_MANAGER_H_
+#include <map>
#include <set>
#include <utility>
#include <vector>
@@ -41,6 +42,7 @@
#include "base/threading/thread_checker.h"
#include "content/common/content_export.h"
#include "media/audio/audio_source_diverter.h"
+#include "media/audio/virtual_audio_sink.h"
namespace media {
class AudioOutputStream;
@@ -66,7 +68,7 @@ class CONTENT_EXPORT AudioMirroringManager {
// to indicate which of them (or none) should have audio routed to this
// MirroringDestination. |results_callback| must be run on the same thread
// as the one that called QueryForMatches().
- typedef base::Callback<void(const std::set<SourceFrameRef>&)>
+ typedef base::Callback<void(const std::set<SourceFrameRef>&, bool)>
miu 2016/05/02 20:06:13 Please document what this new bool argument is for
qiangchen 2016/05/03 16:58:23 Done.
MatchesCallback;
virtual void QueryForMatches(
const std::set<SourceFrameRef>& candidates,
@@ -79,6 +81,9 @@ class CONTENT_EXPORT AudioMirroringManager {
virtual media::AudioOutputStream* AddInput(
const media::AudioParameters& params) = 0;
+ virtual media::AudioPushSink* AddPushInput(
miu 2016/05/02 20:06:12 Need comment here. It should mention this is the
qiangchen 2016/05/03 16:58:23 Done.
+ const media::AudioParameters& params) = 0;
+
protected:
virtual ~MirroringDestination() {}
};
@@ -120,6 +125,9 @@ class CONTENT_EXPORT AudioMirroringManager {
// destination.
MirroringDestination* destination;
+ // The destinations to which audio stream is duplicated.
miu 2016/05/02 20:06:13 Comment should mention that AudioPushSink is owned
qiangchen 2016/05/03 16:58:23 Done.
+ std::map<MirroringDestination*, media::AudioPushSink*> dup_destinations;
miu 2016/05/02 20:06:12 naming nit: How about "duplications" instead? (si
qiangchen 2016/05/03 16:58:23 Done.
+
StreamRoutingState(const SourceFrameRef& source_frame,
Diverter* stream_diverter);
StreamRoutingState(const StreamRoutingState& other);
@@ -136,12 +144,30 @@ class CONTENT_EXPORT AudioMirroringManager {
const std::set<SourceFrameRef>& candidates);
// MirroringDestination query callback. |matches| contains all RenderFrame
- // sources that will be diverted to |destination|. If |add_only| is false,
- // then any Diverters currently routed to |destination| but not found in
- // |matches| will be stopped.
+ // sources that will be diverted or dupliated to |destination|.
miu 2016/05/02 20:06:13 typo: s/dupliated/duplicated/
qiangchen 2016/05/03 16:58:23 Done.
+ // If |add_only| is false, then any Diverters currently routed to
+ // |destination| but not found in |matches| will be stopped.
+ // If |is_duplicate| is true, the audio source will be duplicate to the
miu 2016/05/02 20:06:12 nit: s/audio source will be duplicate to/audio dat
qiangchen 2016/05/03 16:58:23 Done.
+ // destination, otherwise we will divert audio.
void UpdateRoutesToDestination(MirroringDestination* destination,
bool add_only,
- const std::set<SourceFrameRef>& matches);
+ const std::set<SourceFrameRef>& matches,
+ bool is_duplicate);
+
+ // |matches| contains all RenderFrame sources that will be diverted to
+ // |destination|. If |add_only| is false, then any Diverters currently routed
+ // to |destination| but not found in |matches| will be stopped.
+ void UpdateRoutesToDivertDestination(MirroringDestination* destination,
+ bool add_only,
+ const std::set<SourceFrameRef>& matches);
+
+ // |matches| contains all RenderFrame sources that will be duplicated to
+ // |destination|. If |add_only| is false, then any Diverters currently
+ // duplicating to |destination| but not found in |matches| will be stopped.
+ void UpdateRoutesToDuplicateDestination(
+ MirroringDestination* destination,
+ bool add_only,
+ const std::set<SourceFrameRef>& matches);
// Starts diverting audio to the |new_destination|, if not NULL. Otherwise,
// stops diverting audio.

Powered by Google App Engine
This is Rietveld 408576698