Skip to content

Commit

Permalink
add SHAKA_EXPORT to all flags defined in the packager library to make…
Browse files Browse the repository at this point in the history
… sure they are visible in the shared library on Windows
  • Loading branch information
cosmin committed Apr 2, 2024
1 parent a9d3e75 commit 8de25f4
Show file tree
Hide file tree
Showing 12 changed files with 103 additions and 93 deletions.
7 changes: 0 additions & 7 deletions packager/app/test/packager_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1512,13 +1512,6 @@ def testWvmInput(self):
# Output timescale is 90000.
self._CheckTestResults('wvm-input')

# TODO(kqyang): Fix shared_library not supporting strip_parameter_set_nalus
# problem.
@unittest.skipUnless(
test_env.options.libpackager_type == 'static_library',
'libpackager shared_library does not support '
'--strip_parameter_set_nalus flag.'
)
def testWvmInputWithoutStrippingParameterSetNalus(self):
self.encryption_key = '9248d245390e0a49d483ba9b43fc69c3'
self.assertPackageSuccess(
Expand Down
20 changes: 11 additions & 9 deletions packager/file/file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@
#include <packager/macros/compiler.h>
#include <packager/macros/logging.h>

ABSL_FLAG(uint64_t,
io_cache_size,
32ULL << 20,
"Size of the threaded I/O cache, in bytes. Specify 0 to disable "
"threaded I/O.");
ABSL_FLAG(uint64_t,
io_block_size,
1ULL << 16,
"Size of the block size used for threaded I/O, in bytes.");
SHAKA_EXPORT ABSL_FLAG(
uint64_t,
io_cache_size,
32ULL << 20,
"Size of the threaded I/O cache, in bytes. Specify 0 to disable "
"threaded I/O.");
SHAKA_EXPORT ABSL_FLAG(
uint64_t,
io_block_size,
1ULL << 16,
"Size of the block size used for threaded I/O, in bytes.");

namespace shaka {

Expand Down
54 changes: 28 additions & 26 deletions packager/file/http_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,34 @@
#include <packager/macros/logging.h>
#include <packager/version/version.h>

ABSL_FLAG(std::string,
user_agent,
"",
"Set a custom User-Agent string for HTTP requests.");
ABSL_FLAG(std::string,
ca_file,
"",
"Absolute path to the Certificate Authority file for the "
"server cert. PEM format");
ABSL_FLAG(std::string,
client_cert_file,
"",
"Absolute path to client certificate file.");
ABSL_FLAG(std::string,
client_cert_private_key_file,
"",
"Absolute path to the Private Key file.");
ABSL_FLAG(std::string,
client_cert_private_key_password,
"",
"Password to the private key file.");
ABSL_FLAG(bool,
disable_peer_verification,
false,
"Disable peer verification. This is needed to talk to servers "
"without valid certificates.");
SHAKA_EXPORT ABSL_FLAG(std::string,
user_agent,
"",
"Set a custom User-Agent string for HTTP requests.");
SHAKA_EXPORT ABSL_FLAG(
std::string,
ca_file,
"",
"Absolute path to the Certificate Authority file for the "
"server cert. PEM format");
SHAKA_EXPORT ABSL_FLAG(std::string,
client_cert_file,
"",
"Absolute path to client certificate file.");
SHAKA_EXPORT ABSL_FLAG(std::string,
client_cert_private_key_file,
"",
"Absolute path to the Private Key file.");
SHAKA_EXPORT ABSL_FLAG(std::string,
client_cert_private_key_password,
"",
"Password to the private key file.");
SHAKA_EXPORT ABSL_FLAG(
bool,
disable_peer_verification,
false,
"Disable peer verification. This is needed to talk to servers "
"without valid certificates.");

ABSL_DECLARE_FLAG(uint64_t, io_cache_size);

Expand Down
12 changes: 7 additions & 5 deletions packager/file/udp_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
#include <absl/strings/numbers.h>
#include <absl/strings/str_split.h>

#include <packager/export.h>
#include <packager/kv_pairs/kv_pairs.h>

ABSL_FLAG(std::string,
udp_interface_address,
"",
"IP address of the interface over which to receive UDP unicast"
" or multicast streams");
SHAKA_EXPORT ABSL_FLAG(
std::string,
udp_interface_address,
"",
"IP address of the interface over which to receive UDP unicast"
" or multicast streams");

namespace shaka {

Expand Down
14 changes: 8 additions & 6 deletions packager/hls/base/simple_hls_notifier.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,20 @@
#include <absl/strings/escaping.h>
#include <absl/strings/numbers.h>

#include <packager/export.h>
#include <packager/file/file_util.h>
#include <packager/media/base/protection_system_ids.h>
#include <packager/media/base/protection_system_specific_info.h>
#include <packager/media/base/proto_json_util.h>
#include <packager/media/base/widevine_pssh_data.pb.h>

ABSL_FLAG(bool,
enable_legacy_widevine_hls_signaling,
false,
"Specifies whether Legacy Widevine HLS, i.e. v1 is signalled in "
"the media playlist. Applies to Widevine protection system in HLS "
"with SAMPLE-AES only.");
SHAKA_EXPORT ABSL_FLAG(
bool,
enable_legacy_widevine_hls_signaling,
false,
"Specifies whether Legacy Widevine HLS, i.e. v1 is signalled in "
"the media playlist. Applies to Widevine protection system in HLS "
"with SAMPLE-AES only.");

namespace shaka {

Expand Down
8 changes: 4 additions & 4 deletions packager/media/base/widevine_key_source.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
#include <packager/media/base/request_signer.h>
#include <packager/media/base/widevine_common_encryption.pb.h>

ABSL_FLAG(std::string,
video_feature,
"",
"Specify the optional video feature, e.g. HDR.");
SHAKA_EXPORT ABSL_FLAG(std::string,
video_feature,
"",
"Specify the optional video feature, e.g. HDR.");

namespace shaka {
namespace media {
Expand Down
17 changes: 9 additions & 8 deletions packager/media/codecs/h26x_byte_to_unit_stream_converter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@

// TODO(kqyang): Move byte to unit stream convertion to muxer and make it a
// muxer option.
ABSL_FLAG(bool,
strip_parameter_set_nalus,
true,
"When converting from NAL byte stream (AnnexB stream) to NAL unit "
"stream, this flag determines whether to strip parameter sets NAL "
"units, i.e. SPS/PPS for H264 and SPS/PPS/VPS for H265, from the "
"frames. Note that avc1/hvc1 is generated if this flag is enabled; "
"otherwise avc3/hev1 is generated.");
SHAKA_EXPORT ABSL_FLAG(
bool,
strip_parameter_set_nalus,
true,
"When converting from NAL byte stream (AnnexB stream) to NAL unit "
"stream, this flag determines whether to strip parameter sets NAL "
"units, i.e. SPS/PPS for H264 and SPS/PPS/VPS for H265, from the "
"frames. Note that avc1/hvc1 is generated if this flag is enabled; "
"otherwise avc3/hev1 is generated.");

namespace shaka {
namespace media {
Expand Down
11 changes: 6 additions & 5 deletions packager/media/formats/mp4/box_definitions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
#include <packager/media/base/rcheck.h>
#include <packager/media/formats/mp4/box_buffer.h>

ABSL_FLAG(bool,
mvex_before_trak,
false,
"Android MediaExtractor requires mvex to be written before trak. "
"Set the flag to true to comply with the requirement.");
SHAKA_EXPORT ABSL_FLAG(
bool,
mvex_before_trak,
false,
"Android MediaExtractor requires mvex to be written before trak. "
"Set the flag to true to comply with the requirement.");

namespace {
const uint32_t kFourCCSize = 4;
Expand Down
12 changes: 7 additions & 5 deletions packager/media/formats/mp4/track_run_iterator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <absl/flags/flag.h>
#include <absl/log/check.h>

#include <packager/export.h>
#include <packager/macros/logging.h>
#include <packager/media/base/buffer_reader.h>
#include <packager/media/base/fourccs.h>
Expand All @@ -19,11 +20,12 @@
#include <packager/media/formats/mp4/decoding_time_iterator.h>
#include <packager/media/formats/mp4/sync_sample_iterator.h>

ABSL_FLAG(bool,
mp4_reset_initial_composition_offset_to_zero,
true,
"MP4 only. If it is true, reset the initial composition offset to "
"zero, i.e. by assuming that there is a missing EditList.");
SHAKA_EXPORT ABSL_FLAG(
bool,
mp4_reset_initial_composition_offset_to_zero,
true,
"MP4 only. If it is true, reset the initial composition offset to "
"zero, i.e. by assuming that there is a missing EditList.");

namespace {
const int64_t kInvalidOffset = std::numeric_limits<int64_t>::max();
Expand Down
3 changes: 2 additions & 1 deletion packager/mpd/base/mpd_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <absl/strings/str_format.h>
#include <libxml/tree.h>

#include <packager/export.h>
#include <packager/macros/logging.h>
#include <packager/media/base/language_utils.h>
#include <packager/media/base/protection_system_specific_info.h>
Expand All @@ -22,7 +23,7 @@
#include <packager/mpd/base/representation.h>
#include <packager/mpd/base/xml/scoped_xml_ptr.h>

ABSL_FLAG(
SHAKA_EXPORT ABSL_FLAG(
bool,
use_legacy_vp9_codec_string,
false,
Expand Down
27 changes: 15 additions & 12 deletions packager/mpd/base/xml/xml_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,28 @@
#include <absl/strings/str_format.h>
#include <libxml/tree.h>

#include <packager/export.h>
#include <packager/macros/compiler.h>
#include <packager/media/base/rcheck.h>
#include <packager/mpd/base/media_info.pb.h>
#include <packager/mpd/base/mpd_utils.h>
#include <packager/mpd/base/segment_info.h>
#include <packager/mpd/base/xml/scoped_xml_ptr.h>

ABSL_FLAG(bool,
segment_template_constant_duration,
false,
"Generates SegmentTemplate@duration if all segments except the "
"last one has the same duration if this flag is set to true.");

ABSL_FLAG(bool,
dash_add_last_segment_number_when_needed,
false,
"Adds a Supplemental Descriptor with @schemeIdUri "
"set to http://dashif.org/guidelines/last-segment-number with "
"the @value set to the last segment number.");
SHAKA_EXPORT ABSL_FLAG(
bool,
segment_template_constant_duration,
false,
"Generates SegmentTemplate@duration if all segments except the "
"last one has the same duration if this flag is set to true.");

SHAKA_EXPORT ABSL_FLAG(
bool,
dash_add_last_segment_number_when_needed,
false,
"Adds a Supplemental Descriptor with @schemeIdUri "
"set to http://dashif.org/guidelines/last-segment-number with "
"the @value set to the last segment number.");

namespace shaka {

Expand Down
11 changes: 6 additions & 5 deletions packager/mpd/util/mpd_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@
#include <packager/mpd/base/mpd_utils.h>
#include <packager/mpd/base/simple_mpd_notifier.h>

ABSL_FLAG(bool,
generate_dash_if_iop_compliant_mpd,
true,
"Try to generate DASH-IF IOP compliant MPD. This is best effort "
"and does not guarantee compliance.");
SHAKA_EXPORT ABSL_FLAG(
bool,
generate_dash_if_iop_compliant_mpd,
true,
"Try to generate DASH-IF IOP compliant MPD. This is best effort "
"and does not guarantee compliance.");

namespace shaka {

Expand Down

0 comments on commit 8de25f4

Please sign in to comment.