1 // Copyright 2023 Samsung Electronics Inc. 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.
5 #ifndef MEDIA_FILTERS_MEDIA_PLAYER_TIZEN_CLIENT_H_
6 #define MEDIA_FILTERS_MEDIA_PLAYER_TIZEN_CLIENT_H_
8 #include "content/public/browser/web_contents.h"
9 #include "media/base/audio_decoder_config.h"
10 #include "media/base/pipeline_status.h"
11 #include "media/base/video_decoder_config.h"
12 #include "media/base/waiting.h"
13 #include "third_party/abseil-cpp/absl/types/optional.h"
14 #include "ui/gfx/geometry/size.h"
15 #include "ui/gfx/tbm_buffer_handle.h"
19 class MEDIA_EXPORT MediaPlayerTizenClient {
22 virtual void OnError(PipelineStatus status) = 0;
23 virtual void OnFallback(PipelineStatus status) = 0;
24 virtual void OnEnded() = 0;
25 virtual void OnStatisticsUpdate(const PipelineStatistics& stats) = 0;
26 virtual void OnBufferingStateChange(BufferingState state,
27 BufferingStateChangeReason reason) = 0;
28 virtual void OnWaiting(WaitingReason reason) = 0;
29 virtual void OnAudioConfigChange(const AudioDecoderConfig& config) = 0;
30 virtual void OnVideoConfigChange(const VideoDecoderConfig& config) = 0;
31 virtual void OnVideoNaturalSizeChange(const gfx::Size& size) = 0;
32 virtual void OnVideoOpacityChange(bool opaque) = 0;
33 virtual void OnVideoFrameRateChange(absl::optional<int> fps) = 0;
34 virtual void OnRequestSeek(base::TimeDelta time) = 0;
35 virtual void OnRequestSuspend(bool resource_conflict) = 0;
37 // MediaPlayerRendererClientExtension
38 virtual void OnVideoSizeChange(const gfx::Size& size) = 0;
39 virtual void OnDurationChange(base::TimeDelta duration) = 0;
40 virtual void OnBufferUpdate(base::TimeDelta time) = 0;
41 #if defined(TIZEN_TBM_SUPPORT)
42 virtual void OnNewTbmFrameAvailable(uint32_t player_id,
43 gfx::TbmBufferHandle tbm_buffer_handle,
44 base::TimeDelta timestamp) = 0;
46 virtual void OnNewFrameAvailable(uint32_t playerId,
47 base::UnsafeSharedMemoryRegion frame,
49 base::TimeDelta timestamp,
57 #endif // MEDIA_FILTERS_MEDIA_PLAYER_TIZEN_CLIENT_H_