Skip to content

Commit

Permalink
feat: test coverage for SAMPLE-AES
Browse files Browse the repository at this point in the history
  • Loading branch information
lee.fordyce committed Dec 4, 2023
1 parent cd585eb commit 302953d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/packager/live_packager.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ struct LiveConfig {
// TOOD: do we need non-integer durations?
double segment_duration_sec;

// TODO: AES-128
// TODO: should we allow for keys to be hex string?
std::vector<uint8_t> iv_;
std::vector<uint8_t> key_;
std::vector<uint8_t> key_id_;
Expand Down
7 changes: 4 additions & 3 deletions packager/live_packager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@

#include <absl/log/globals.h>
#include <absl/log/log.h>
#include <absl/strings/escaping.h>
#include <packager/chunking_params.h>
#include <packager/file.h>
#include <packager/file/file_closer.h>
#include <packager/live_packager.h>
#include <packager/media/base/aes_encryptor.h>
#include <packager/packager.h>
Expand Down Expand Up @@ -134,7 +132,7 @@ struct LivePackager::LivePackagerInternal {
};

LivePackager::LivePackager(const LiveConfig& config) : config_(config) {
absl::SetMinLogLevel(absl::LogSeverityAtLeast::kInfo);
absl::SetMinLogLevel(absl::LogSeverityAtLeast::kWarning);
std::unique_ptr<LivePackagerInternal> internal(new LivePackagerInternal);

if (config.protection_scheme_ == LiveConfig::EncryptionScheme::AES128 &&
Expand All @@ -151,6 +149,9 @@ LivePackager::~LivePackager() {}

Status LivePackager::PackageInit(const Segment& init_segment,
FullSegmentBuffer& output) {
if (!internal_)
return Status(error::INVALID_ARGUMENT, "Failed to initialize");

SegmentDataReader reader(init_segment);

shaka::BufferCallbackParams callback_params;
Expand Down

0 comments on commit 302953d

Please sign in to comment.