Skip to content

Commit

Permalink
Change the field name to id
Browse files Browse the repository at this point in the history
  • Loading branch information
david-winder-kaltura committed Oct 3, 2023
1 parent 5e73e56 commit 9953ff3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ Mandatory fields:
an empty captions file (useful in case only some videos in a playlist have captions)

Optional fields:
* `id` - a string that identifies the source clip
* `sourceType` - sets the interface that should be used to read the MP4 file, allowed values are:
`file` and `http`. By default, the module uses `http` if `vod_remote_upstream_location` is set,
and `file` otherwise.
Expand All @@ -584,7 +585,6 @@ Optional fields:
to decrypt the file.
* `encryptionScheme` - the encryption scheme that was used to encrypt the file. Currently,
only two schemes are supported - `cenc` for MP4 files, `aes-cbc` for caption files.
* `id3TagLabel` - a string contain label to insert in the data stream. This will be done only when `vod_hls_mpegts_output_id3_timestamps` is ON and the root sequnce has ID

#### Rate filter clip

Expand Down
16 changes: 8 additions & 8 deletions vod/hls/hls_muxer.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

#define ID3_TEXT_JSON_FORMAT "{\"timestamp\":%uL}%Z"
#define ID3_TEXT_JSON_SEQUENCE_ID_PREFIX_FORMAT "{\"timestamp\":%uL,\"sequenceId\":\""
#define ID3_TEXT_JSON_CLIP_LABEL_FORMAT "\",\"clipLabel\":\""
#define ID3_TEXT_JSON_CLIP_ID_FORMAT "\",\"clipId\":\""
#define ID3_TEXT_JSON_SEQUENCE_ID_SUFFIX "\"}"

#define CLIP_LABEL_MAX_SIZE 32
#define CLIP_ID_MAX_SIZE 32

// from ffmpeg mpegtsenc
#define DEFAULT_PES_HEADER_FREQ 16
Expand Down Expand Up @@ -174,7 +174,7 @@ hls_muxer_init_id3_stream(
size_t data_size;
int64_t timestamp;
void* frames_source_context;
vod_str_t clip_label;
vod_str_t clip_id;

cur_stream = state->last_stream;

Expand Down Expand Up @@ -202,7 +202,7 @@ hls_muxer_init_id3_stream(
sequence_id_escape = vod_escape_json(NULL, sequence_id->data, sequence_id->len);
data_size = sizeof(ID3_TEXT_JSON_SEQUENCE_ID_PREFIX_FORMAT) + VOD_INT64_LEN +
sequence_id->len + sequence_id_escape +
sizeof(ID3_TEXT_JSON_CLIP_LABEL_FORMAT) + CLIP_LABEL_MAX_SIZE +
sizeof(ID3_TEXT_JSON_CLIP_ID_FORMAT) + CLIP_ID_MAX_SIZE +
sizeof(ID3_TEXT_JSON_SEQUENCE_ID_SUFFIX);
}
else
Expand Down Expand Up @@ -274,11 +274,11 @@ hls_muxer_init_id3_stream(
p = vod_copy(p, sequence_id->data, sequence_id->len);
}

clip_label = ref_track->file_info.source->id3_tag_label;
if (clip_label.len != 0)
clip_id = ref_track->file_info.source->id;
if (clip_id.len != 0)
{
p = vod_copy(p, ID3_TEXT_JSON_CLIP_LABEL_FORMAT, sizeof(ID3_TEXT_JSON_CLIP_LABEL_FORMAT) - 1);
p = vod_copy(p, clip_label.data, vod_min(CLIP_LABEL_MAX_SIZE, clip_label.len));
p = vod_copy(p, ID3_TEXT_JSON_CLIP_ID_FORMAT, sizeof(ID3_TEXT_JSON_CLIP_ID_FORMAT) - 1);
p = vod_copy(p, clip_id.data, vod_min(CLIP_ID_MAX_SIZE, clip_id.len));
}

p = vod_copy(p, ID3_TEXT_JSON_SEQUENCE_ID_SUFFIX, sizeof(ID3_TEXT_JSON_SEQUENCE_ID_SUFFIX));
Expand Down
2 changes: 1 addition & 1 deletion vod/media_clip.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ typedef struct ngx_http_vod_reader_s ngx_http_vod_reader_t;
struct media_clip_source_s {
// base
media_clip_t base;
vod_str_t id;
int64_t clip_time;
media_range_t* range;
media_track_array_t track_array;
Expand Down Expand Up @@ -94,7 +95,6 @@ struct media_clip_source_s {

media_clip_source_t* next;
uint64_t last_offset;
vod_str_t id3_tag_label;
};

typedef struct {
Expand Down
2 changes: 1 addition & 1 deletion vod/media_set_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ static json_parser_union_type_def_t media_clip_union_params[] = {
};

static json_object_value_def_t media_clip_source_params[] = {
{ vod_string("id"), VOD_JSON_STRING, offsetof(media_clip_source_t, id), media_set_parse_null_term_string },
{ vod_string("path"), VOD_JSON_STRING, offsetof(media_clip_source_t, mapped_uri), media_set_parse_null_term_string },
{ vod_string("tracks"), VOD_JSON_STRING, offsetof(media_clip_source_t, tracks_mask), media_set_parse_tracks_spec },
{ vod_string("clipFrom"), VOD_JSON_INT, offsetof(media_clip_source_t, clip_from), media_set_parse_int64 },
{ vod_string("encryptionScheme"), VOD_JSON_STRING, offsetof(media_clip_source_t, encryption.scheme), media_set_parse_encryption_scheme },
{ vod_string("encryptionKey"), VOD_JSON_STRING, offsetof(media_clip_source_t, encryption.key), media_set_parse_base64_string },
{ vod_string("encryptionIv"), VOD_JSON_STRING, offsetof(media_clip_source_t, encryption.iv), media_set_parse_base64_string },
{ vod_string("sourceType"), VOD_JSON_STRING, offsetof(media_clip_source_t, source_type), media_set_parse_source_type },
{ vod_string("id3TagLabel"), VOD_JSON_STRING, offsetof(media_clip_source_t, id3_tag_label), media_set_parse_null_term_string },
{ vod_null_string, 0, 0, NULL }
};

Expand Down

0 comments on commit 9953ff3

Please sign in to comment.