shaka-packager/packager/media/base
Joey Parrish af98d48726
fix: Fix flush/close semantics for HTTP files, improve testing (#1232)
All HTTP-based tests now use an embedded test server instead of
httpbin.org, which makes them much faster and more reliable.

These more reliable tests also exposed some issues that began recently
with PR #1201.  HttpFile's Flush() semantics were different than those
documented for files in general.  Flush() used to close the file for
uploading, so that no further writes were allowed, but the documentation
stated that it would only flush data to its destination.  PR #1201
brought HttpFile's Flush() in line with the docs, but gave us no way to
terminate a chunked upload.

This adds a new method to File called CloseForWriting(), which
terminates a chunked upload for HttpFile.  The only other implementation
that does anything is UdpFile, which uses the socket library function
shutdown() to terminate writes while allowing reads.

This also tweaks HttpFile::CloseWithStatus() so that it will not
generate an error if the file is closed before the HTTP response is
written to the download cache.

This modifies the test HttpFileTest.MultipleWrites so that the file is
Flushed after each chunk.  This adds test coverage for the changes
introduced in PR #1201.

Fixes #1224 (missing test coverage for HttpFile::Flush)
2023-07-13 18:55:48 -07:00
..
test feat: Port AES and RSA crypto to mbedtls (#1119) 2022-11-02 08:34:06 -07:00
CMakeLists.txt fix: Fix flush/close semantics for HTTP files, improve testing (#1232) 2023-07-13 18:55:48 -07:00
aes_cryptor.cc feat: Port AES and RSA crypto to mbedtls (#1119) 2022-11-02 08:34:06 -07:00
aes_cryptor.h feat: Port AES and RSA crypto to mbedtls (#1119) 2022-11-02 08:34:06 -07:00
aes_cryptor_unittest.cc feat: port media/codecs to CMake (#1143) 2022-12-15 16:53:36 -08:00
aes_decryptor.cc feat: Port AES and RSA crypto to mbedtls (#1119) 2022-11-02 08:34:06 -07:00
aes_decryptor.h feat: Port AES and RSA crypto to mbedtls (#1119) 2022-11-02 08:34:06 -07:00
aes_encryptor.cc feat: Port AES and RSA crypto to mbedtls (#1119) 2022-11-02 08:34:06 -07:00
aes_encryptor.h feat: Port AES and RSA crypto to mbedtls (#1119) 2022-11-02 08:34:06 -07:00
aes_pattern_cryptor.cc feat: Port AES and RSA crypto to mbedtls (#1119) 2022-11-02 08:34:06 -07:00
aes_pattern_cryptor.h feat: Port AES and RSA crypto to mbedtls (#1119) 2022-11-02 08:34:06 -07:00
aes_pattern_cryptor_unittest.cc feat: Port AES and RSA crypto to mbedtls (#1119) 2022-11-02 08:34:06 -07:00
audio_stream_info.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
audio_stream_info.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
audio_timestamp_helper.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
audio_timestamp_helper.h feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
audio_timestamp_helper_unittest.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
bit_reader.cc Properly handle SkipBytes with num_bytes as 0 2020-12-23 11:08:33 -08:00
bit_reader.h feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
bit_reader_unittest.cc Properly handle SkipBytes with num_bytes as 0 2020-12-23 11:08:33 -08:00
bit_writer.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
bit_writer.h feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
bit_writer_unittest.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
buffer_reader.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
buffer_reader.h feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
buffer_writer.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
buffer_writer.h feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
buffer_writer_unittest.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
byte_queue.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
byte_queue.h feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
cc_stream_filter.cc Add cc_index to stream descriptor. 2021-02-17 18:33:53 +00:00
cc_stream_filter.h feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
common_pssh_generator.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
common_pssh_generator.h feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
container_names.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
container_names.h Share chunkers from the same input except for WVM 2018-01-22 17:43:25 -08:00
container_names_unittest.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
decrypt_config.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
decrypt_config.h feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
decryptor_source.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
decryptor_source.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
decryptor_source_unittest.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
encryption_config.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
fourccs.h Added MPEG-H support (mha1, mhm1) 2021-06-29 23:10:53 -07:00
http_key_fetcher.cc fix: Fix flush/close semantics for HTTP files, improve testing (#1232) 2023-07-13 18:55:48 -07:00
http_key_fetcher.h test: Revert "Retry HTTP file tests on temporary httpbin failure" (#1230) 2023-07-13 15:55:36 -07:00
http_key_fetcher_unittest.cc fix: Fix flush/close semantics for HTTP files, improve testing (#1232) 2023-07-13 18:55:48 -07:00
id3_tag.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
id3_tag.h Implemented PackedAudioSegmenter 2018-05-16 21:52:11 +00:00
id3_tag_unittest.cc Implemented Id3Tag class to handle ID3 tag 2018-05-16 01:04:02 +00:00
key_fetcher.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
key_fetcher.h feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
key_source.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
key_source.h feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
language_utils.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
language_utils.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
limits.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
macros.h feat: port media/codecs to CMake (#1143) 2022-12-15 16:53:36 -08:00
media_handler.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
media_handler.h feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
media_handler_test_base.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
media_handler_test_base.h feat: CMake port media/trick_play (#1146) 2023-05-01 14:57:40 -07:00
media_parser.h feat: port media/formats/webm to CMake (#1147) 2022-12-16 21:40:00 -08:00
media_sample.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
media_sample.h feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
mock_aes_cryptor.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
muxer.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
muxer.h feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
muxer_options.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
muxer_options.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
muxer_util.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
muxer_util.h feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
muxer_util_unittest.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
offset_byte_queue.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
offset_byte_queue.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
offset_byte_queue_unittest.cc Replace scoped_ptr with std::unique_ptr 2016-08-18 17:12:36 -07:00
playready_key_source.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
playready_key_source.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
playready_pssh_generator.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
playready_pssh_generator.h feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
producer_consumer_queue.h feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
producer_consumer_queue_unittest.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
protection_system_ids.h Support Marlin DRM signaling in DASH 2018-10-01 20:22:58 +00:00
protection_system_specific_info.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
protection_system_specific_info.h feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
protection_system_specific_info_unittest.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
proto_json_util.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
proto_json_util.h Remove the usage of JsonWriter in SimpleHlsNotifier 2018-05-15 20:06:54 +00:00
pssh_generator.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
pssh_generator.h feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
pssh_generator_unittest.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
pssh_generator_util.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
pssh_generator_util.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
range.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
raw_key_source.cc feat: port media/codecs to CMake (#1143) 2022-12-15 16:53:36 -08:00
raw_key_source.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
raw_key_source_unittest.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
rcheck.h feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
request_signer.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
request_signer.h feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
rsa_key.cc feat: Port AES and RSA crypto to mbedtls (#1119) 2022-11-02 08:34:06 -07:00
rsa_key.h feat: Port AES and RSA crypto to mbedtls (#1119) 2022-11-02 08:34:06 -07:00
rsa_key_unittest.cc feat: Port AES and RSA crypto to mbedtls (#1119) 2022-11-02 08:34:06 -07:00
stream_info.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
stream_info.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
text_muxer.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
text_muxer.h cleanup: Convert all time parameters to signed 2021-08-05 18:24:15 +00:00
text_sample.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
text_sample.h feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
text_stream_info.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
text_stream_info.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
text_track.h feat: port media/formats/webm to CMake (#1147) 2022-12-16 21:40:00 -08:00
text_track_config.cc Rename top level namespace to shaka 2016-05-24 21:55:55 +00:00
text_track_config.h Rename top level namespace to shaka 2016-05-24 21:55:55 +00:00
timestamp.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
video_stream_info.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
video_stream_info.h feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
video_util.cc Move DerivePixelWidthHeight to video_util.cc 2019-08-05 11:56:20 -07:00
video_util.h Move DerivePixelWidthHeight to video_util.cc 2019-08-05 11:56:20 -07:00
video_util_unittest.cc Move DerivePixelWidthHeight to video_util.cc 2019-08-05 11:56:20 -07:00
widevine_common_encryption.proto Add a flag --video_feature for Widevine 2019-04-16 07:55:08 -07:00
widevine_key_source.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
widevine_key_source.h feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
widevine_key_source_unittest.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
widevine_pssh_data.proto chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
widevine_pssh_generator.cc feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
widevine_pssh_generator.h feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00