Skip to content

Commit

Permalink
Set default color depth to 8 in nplb tests
Browse files Browse the repository at this point in the history
1. Set the default |color_metadata.bits_per_channel| to 8 for nplb
   tests.
2. Re-enable SbPlayerTest.MaxVideoCapabilities tests.
3. Added default initializer for AudioStreamInfo, AudioSampleInfo,
   VideoStreamInfo and VideoSampleInfo.

b/292319097
  • Loading branch information
jasonzhangxx committed Jan 21, 2025
1 parent 41f30d8 commit 191c4ca
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
3 changes: 0 additions & 3 deletions starboard/android/shared/test_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@
# TODO: Filter this test on a per-device basis.
'SbMediaCanPlayMimeAndKeySystem.MinimumSupport',

# TODO: b/292319097 Make this test work on lab devices consistently.
'SbPlayerTest.MaxVideoCapabilities',

# TODO: b/280432564 Make this test work on lab devices consistently.
'SbAudioSinkTest.ContinuousAppend',

Expand Down
1 change: 1 addition & 0 deletions starboard/nplb/player_creation_param_helpers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ VideoStreamInfo CreateVideoStreamInfo(SbMediaVideoCodec codec) {

video_stream_info.mime = "";
video_stream_info.max_video_capabilities = "";
video_stream_info.color_metadata.bits_per_channel = 8;
video_stream_info.color_metadata.primaries = kSbMediaPrimaryIdBt709;
video_stream_info.color_metadata.transfer = kSbMediaTransferIdBt709;
video_stream_info.color_metadata.matrix = kSbMediaMatrixIdBt709;
Expand Down
18 changes: 9 additions & 9 deletions starboard/shared/starboard/media/media_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ struct AudioStreamInfo {
// of `SbMediaAudioStreamInfo` for more details.
SbMediaAudioCodec codec = kSbMediaAudioCodecNone;
std::string mime;
uint16_t number_of_channels;
uint32_t samples_per_second;
uint16_t bits_per_sample;
uint16_t number_of_channels = 0;
uint32_t samples_per_second = 0;
uint16_t bits_per_sample = 0;
std::vector<uint8_t> audio_specific_config;
};

Expand Down Expand Up @@ -82,7 +82,7 @@ struct AudioSampleInfo {
// The member variables are the C++ mappings of the members of
// `SbMediaAudioSampleInfo` defined in `media.h`. Please refer to the comment
// of `SbMediaAudioSampleInfo` for more details.
AudioStreamInfo stream_info;
AudioStreamInfo stream_info = {};
int64_t discarded_duration_from_front = 0; // in microseconds.
int64_t discarded_duration_from_back = 0; // in microseconds.
};
Expand Down Expand Up @@ -111,9 +111,9 @@ struct VideoStreamInfo {
SbMediaVideoCodec codec = kSbMediaVideoCodecNone;
std::string mime;
std::string max_video_capabilities;
int frame_width;
int frame_height;
SbMediaColorMetadata color_metadata;
int frame_width = 0;
int frame_height = 0;
SbMediaColorMetadata color_metadata = {};
};

bool operator==(const VideoStreamInfo& left, const VideoStreamInfo& right);
Expand All @@ -140,8 +140,8 @@ struct VideoSampleInfo {
// The member variables are the C++ mappings of the members of
// `SbMediaVideoSampleInfo` defined in `media.h`. Please refer to the comment
// of `SbMediaVideoSampleInfo` for more details.
VideoStreamInfo stream_info;
bool is_key_frame;
VideoStreamInfo stream_info = {};
bool is_key_frame = false;
};

std::ostream& operator<<(std::ostream& os, const VideoSampleInfo& stream_info);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ media::VideoStreamInfo CreateVideoStreamInfo(SbMediaVideoCodec codec) {
video_stream_info.mime = "";
video_stream_info.max_video_capabilities = "";

video_stream_info.color_metadata.bits_per_channel = 8;
video_stream_info.color_metadata.primaries = kSbMediaPrimaryIdBt709;
video_stream_info.color_metadata.transfer = kSbMediaTransferIdBt709;
video_stream_info.color_metadata.matrix = kSbMediaMatrixIdBt709;
Expand Down

0 comments on commit 191c4ca

Please sign in to comment.