Skip to content

Commit 5b759cd

Browse files
committed
Fix format issue
1 parent 471b059 commit 5b759cd

File tree

8 files changed

+52
-36
lines changed

8 files changed

+52
-36
lines changed

packages/video_player_avplay/tizen/inc/plusplayer_capi/property.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ extern "C" {
3636
* @brief Enumerations for plusplayer property.
3737
*/
3838
typedef enum {
39-
PLUSPLAYER_PROPERTY_ADAPTIVE_INFO, /**< String containing custom
40-
attributes for adaptive streaming
41-
playback. Effective only for
42-
Adaptive Streaming Protocols.*/
39+
PLUSPLAYER_PROPERTY_ADAPTIVE_INFO, /**< String containing custom
40+
attributes for adaptive streaming
41+
playback. Effective only for
42+
Adaptive Streaming Protocols.*/
4343
PLUSPLAYER_PROPERTY_LISTEN_SPARSE_TRACK, /**< Sparse track is a
4444
lightweight timeline-synced
4545
stream used for captions,

packages/video_player_avplay/tizen/inc/plusplayer_capi/track.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ typedef enum {
4343
PLUSPLAYER_TRACK_TYPE_SUBTITLE /**< Track type Subtitle */
4444
} plusplayer_track_type_e;
4545

46-
4746
#ifdef __cplusplus
4847
} // extern "C"
4948
#endif

packages/video_player_avplay/tizen/inc/plusplayer_capi/track_capi.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,8 @@ int plusplayer_get_track_layer(plusplayer_track_h track, int* track_layer);
511511
* @code
512512
* plusplayer_track_h track = ...;
513513
* int track_bits_per_sample;
514-
* plusplayer_get_track_bits_per_sample(track, &track_bits_per_sample);
514+
* plusplayer_get_track_bits_per_sample(track,
515+
* &track_bits_per_sample);
515516
* // ... your codes ...
516517
* @endcode
517518
* @pre The track handle must be valid.
@@ -674,7 +675,8 @@ int plusplayer_get_track_lang_code(plusplayer_track_h track,
674675
* @code
675676
* plusplayer_track_h track = ...;
676677
* const char* track_subtitle_format;
677-
* plusplayer_get_track_subtitle_format(track, &track_subtitle_format);
678+
* plusplayer_get_track_subtitle_format(track,
679+
* &track_subtitle_format);
678680
* // ... your codes ...
679681
* @endcode
680682
* @pre The track handle must be valid.

packages/video_player_avplay/tizen/src/drm_manager.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ int DrmManager::UpdatePsshData(const void *data, int length) {
154154
return ret;
155155
}
156156

157-
bool DrmManager::SecurityInitCompleteCB(Plusplayer_DrmHandle *drm_handle, unsigned int len,
157+
bool DrmManager::SecurityInitCompleteCB(Plusplayer_DrmHandle *drm_handle,
158+
unsigned int len,
158159
unsigned char *pssh_data,
159160
void *user_data) {
160161
// IMPORTANT: SetDataParam_t cannot be stack allocated because

packages/video_player_avplay/tizen/src/drm_manager.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77

88
#include <Ecore.h>
99
#include <flutter/method_channel.h>
10+
#include <plusplayer_capi/plusplayer_capi.h>
1011

1112
#include <mutex>
1213
#include <queue>
1314

14-
#include <plusplayer_capi/plusplayer_capi.h>
15-
1615
class DrmManager {
1716
public:
1817
typedef enum {
@@ -30,8 +29,9 @@ class DrmManager {
3029
bool SetChallenge(const std::string &media_url,
3130
flutter::BinaryMessenger *binary_messenger);
3231
bool GetDrmHandle(int *handle);
33-
bool SecurityInitCompleteCB(Plusplayer_DrmHandle *drm_handle, unsigned int len,
34-
unsigned char *pssh_data, void *user_data);
32+
bool SecurityInitCompleteCB(Plusplayer_DrmHandle *drm_handle,
33+
unsigned int len, unsigned char *pssh_data,
34+
void *user_data);
3535
int UpdatePsshData(const void *data, int length);
3636
void ReleaseDrmSession();
3737

packages/video_player_avplay/tizen/src/plus_player.cc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ flutter::EncodableValue ParseVideoTrack(const plusplayer_track_h track) {
462462
LOG_DEBUG(
463463
"[PlusPlayer] video track info : trackId : %d, mimetype : %s, width : "
464464
"%d, height : %d, birate : %d",
465-
index, mimetype, width, height, bitrate);
465+
track_index, mimetype, width, height, bitrate);
466466
return flutter::EncodableValue(video_track_result);
467467
}
468468

@@ -711,9 +711,13 @@ std::string PlusPlayer::GetStreamingProperty(
711711
return "";
712712
}
713713
char *value;
714-
if (plusplayer_get_property(player_,
715-
ConvertPropertyType(streaming_property_type),
716-
&value) != PLUSPLAYER_ERROR_TYPE_NONE) {
714+
plusplayer_property_e property = ConvertPropertyType(streaming_property_type);
715+
if (property == static_cast<plusplayer_property_e>(-1)) {
716+
LOG_ERROR("[PlusPlayer]:Player fail to convert property type");
717+
return "";
718+
}
719+
if (plusplayer_get_property(player_, property, &value) !=
720+
PLUSPLAYER_ERROR_TYPE_NONE) {
717721
LOG_ERROR("[PlusPlayer]:Player fail to get streaming property");
718722
return "";
719723
}
@@ -768,7 +772,6 @@ void PlusPlayer::SetStreamingProperty(const std::string &type,
768772
LOG_INFO("[PlusPlayer] Streaming property value is true");
769773
// TODO: handle true case if needed
770774
}
771-
// plusplayer_set_adaptive_streaming_control_event_cb is not applicable here
772775
}
773776

774777
bool PlusPlayer::SetDisplayRotate(int64_t rotation) {

packages/video_player_avplay/tizen/src/plus_player.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
#include "device_proxy.h"
1414
#include "drm_manager.h"
1515
#include "messages.h"
16+
#include "plus_player_util.h"
1617
#include "plusplayer_capi/plusplayer_capi.h"
1718
#include "video_player.h"
18-
#include "plus_player_util.h"
1919

2020
namespace video_player_avplay_tizen {
2121

packages/video_player_avplay/tizen/src/plus_player_util.cc

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// found in the LICENSE file.
44

55
#include "plus_player_util.h"
6+
67
#include "log.h"
78
namespace video_player_avplay_tizen {
89

@@ -15,20 +16,30 @@ static const std::unordered_map<std::string, plusplayer_track_type_e>
1516
{"audio", plusplayer_track_type_e::PLUSPLAYER_TRACK_TYPE_AUDIO},
1617
{"text", plusplayer_track_type_e::PLUSPLAYER_TRACK_TYPE_SUBTITLE}};
1718

18-
static const std::unordered_map<std::string, plusplayer_property_e> kMap = {
19-
{"ADAPTIVE_INFO", plusplayer_property_e::PLUSPLAYER_PROPERTY_ADAPTIVE_INFO},
20-
{"LISTEN_SPARSE_TRACK",
21-
plusplayer_property_e::PLUSPLAYER_PROPERTY_LISTEN_SPARSE_TRACK},
22-
{"AVAILABLE_BITRATE",
23-
plusplayer_property_e::PLUSPLAYER_PROPERTY_AVAILABLE_BITRATE},
24-
{"CURRENT_BANDWIDTH",
25-
plusplayer_property_e::PLUSPLAYER_PROPERTY_CURRENT_BANDWIDTH},
26-
{"GET_LIVE_DURATION",
27-
plusplayer_property_e::PLUSPLAYER_PROPERTY_LIVE_DURATION},
28-
{"IS_LIVE", plusplayer_property_e::PLUSPLAYER_PROPERTY_IS_LIVE},
29-
{"TOKEN", plusplayer_property_e::PLUSPLAYER_PROPERTY_TOKEN},
30-
{"OPEN_HTTP_HEADER",
31-
plusplayer_property_e::PLUSPLAYER_PROPERTY_OPEN_HTTP_HEADER}};
19+
static std::unordered_map<std::string, plusplayer_property_e>
20+
kConvertPropertyMap = {
21+
{"ADAPTIVE_INFO", PLUSPLAYER_PROPERTY_ADAPTIVE_INFO},
22+
{"LISTEN_SPARSE_TRACK", PLUSPLAYER_PROPERTY_LISTEN_SPARSE_TRACK},
23+
{"CONFIG_LOW_LATENCY", PLUSPLAYER_PROPERTY_CONFIG_LOW_LATENCY},
24+
{"ATSC3_L1_SERVER_TIME", PLUSPLAYER_PROPERTY_ATSC3_L1_SERVER_TIME},
25+
{"AUDIO_DESCRIPTION", PLUSPLAYER_PROPERTY_AUDIO_DESCRIPTION},
26+
{"PRESELECTION_TAG", PLUSPLAYER_PROPERTY_PRESELECTION_TAG},
27+
{"USE_MAIN_OUT_SHARE", PLUSPLAYER_PROPERTY_USE_MAIN_OUT_SHARE},
28+
{"TOKEN", PLUSPLAYER_PROPERTY_TOKEN},
29+
{"USER_LOW_LATENCY", PLUSPLAYER_PROPERTY_USER_LOW_LATENCY},
30+
{"MAX_BANDWIDTH", PLUSPLAYER_PROPERTY_MAX_BANDWIDTH},
31+
{"MPEGH_METADATA", PLUSPLAYER_PROPERTY_MPEGH_METADATA},
32+
{"OPEN_HTTP_HEADER", PLUSPLAYER_PROPERTY_OPEN_HTTP_HEADER},
33+
{"IS_LIVE", PLUSPLAYER_PROPERTY_IS_LIVE},
34+
{"AVAILABLE_BITRATE", PLUSPLAYER_PROPERTY_AVAILABLE_BITRATE},
35+
{"GET_LIVE_DURATION", PLUSPLAYER_PROPERTY_LIVE_DURATION},
36+
{"CURRENT_BANDWIDTH", PLUSPLAYER_PROPERTY_CURRENT_BANDWIDTH},
37+
{"CUR_LATENCY", PLUSPLAYER_PROPERTY_CUR_LATENCY},
38+
{"IS_DVB_DASH", PLUSPLAYER_PROPERTY_IS_DVB_DASH},
39+
{"LIVE_PLAYER_START", PLUSPLAYER_PROPERTY_LIVE_PLAYER_START},
40+
{"START_DATE", PLUSPLAYER_PROPERTY_START_DATE},
41+
{"DASH_STREAM_INFO", PLUSPLAYER_PROPERTY_DASH_STREAM_INFO},
42+
{"HTTP_HEADER", PLUSPLAYER_PROPERTY_HTTP_HEADER}};
3243

3344
plusplayer_track_type_e ConvertTrackType(const std::string &track_type) {
3445
auto it = kTrackMap.find(track_type);
@@ -40,11 +51,11 @@ plusplayer_track_type_e ConvertTrackType(const std::string &track_type) {
4051
}
4152

4253
plusplayer_property_e ConvertPropertyType(const std::string &type_value) {
43-
auto it = kMap.find(type_value);
44-
if (it != kMap.end()) {
45-
return it->second;
54+
for (const auto &pair : kConvertPropertyMap) {
55+
if (pair.first == type_value) {
56+
return pair.second;
57+
}
4658
}
47-
// Return an invalid sentinel value if not found.
4859
return static_cast<plusplayer_property_e>(-1);
4960
}
5061

0 commit comments

Comments
 (0)