Skip to content

Commit

Permalink
Move SbPlayerPipeline declaration to .h file (youtube#535)
Browse files Browse the repository at this point in the history
The declaration of SbPlayerPipeline was in sbplayer_pipeline.cc so other
code won't depend on SbPlayerPipeline directly.  Instead, they'd create
it using Pipeline::Create() (which creates an SbPlayerPipeline
internally) and access it via the Pipeline interface.

We are trying to reduce the size of sbplayer_pipeline.cc (it's >1700
loc as of today).  Moving the declaration to an .h file reduces ~400
lines, which outweighs the benefit mentioned above.

There are no functional changes, except that Pipeline::Create() is
removed, as now SbPlayerPipeline can be created directly.

b/285639635
  • Loading branch information
xiaomings authored Jun 5, 2023
1 parent ec5026f commit abf4cea
Show file tree
Hide file tree
Showing 5 changed files with 364 additions and 363 deletions.
1 change: 1 addition & 0 deletions cobalt/media/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ component("media") {
"base/sbplayer_interface.cc",
"base/sbplayer_interface.h",
"base/sbplayer_pipeline.cc",
"base/sbplayer_pipeline.h",
"base/sbplayer_set_bounds_helper.cc",
"base/sbplayer_set_bounds_helper.h",
"decoder_buffer_allocator.cc",
Expand Down
11 changes: 0 additions & 11 deletions cobalt/media/base/pipeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,6 @@ class MEDIA_EXPORT Pipeline : public base::RefCountedThreadSafe<Pipeline> {
OnEncryptedMediaInitDataEncounteredCB;
#endif // SB_HAS(PLAYER_WITH_URL)

static scoped_refptr<Pipeline> Create(
SbPlayerInterface* interface, PipelineWindow window,
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
const GetDecodeTargetGraphicsContextProviderFunc&
get_decode_target_graphics_context_provider_func,
bool allow_resume_after_suspend, bool allow_batched_sample_write,
#if SB_API_VERSION >= 15
SbTime audio_write_duration_local, SbTime audio_write_duration_remote,
#endif // SB_API_VERSION >= 15
MediaLog* media_log, DecodeTargetProvider* decode_target_provider);

virtual ~Pipeline() {}

virtual void Suspend() {}
Expand Down
Loading

0 comments on commit abf4cea

Please sign in to comment.