mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2025-01-08 11:11:51 +00:00
Merge branch 'master' of github.com:mbunkus/mkvtoolnix
This commit is contained in:
commit
b857a89011
98
po/ja.po
98
po/ja.po
@ -2,14 +2,14 @@
|
||||
# Copyright (C) 2009 Moritz Bunkus
|
||||
# This file is distributed under the same license as the mkvtoolnix package.
|
||||
#
|
||||
# Hiroki Taniura <boiled.sugar@gmail.com> 2009-2012.
|
||||
# Hiroki Taniura <boiled.sugar@gmail.com> 2009-2013.
|
||||
# Katsuhiko Nishimra <kat841@hotmail.com> 2010.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: ja\n"
|
||||
"Report-Msgid-Bugs-To: Hiroki Taniura <boiled.sugar@gmail.com>\n"
|
||||
"POT-Creation-Date: 2009-02-27 00:38+0900\n"
|
||||
"PO-Revision-Date: 2013-02-27 02:29+0900\n"
|
||||
"PO-Revision-Date: 2013-04-12 22:32+0900\n"
|
||||
"Last-Translator: Hiroki Taniura <boiled.sugar@gmail.com>\n"
|
||||
"Language-Team: Japanese <boiled.sugar@gmail.com>\n"
|
||||
"Language: ja\n"
|
||||
@ -278,15 +278,15 @@ msgid " --engage <feature> Turns on experimental feature 'feature'.\n"
|
||||
msgstr " --engage <feature> 実験的な機能である'feature'を有効化します。\n"
|
||||
|
||||
#: src/merge/mkvmerge.cpp:222
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
" --fix-bitstream-timing-information <TID[:bool]>\n"
|
||||
" Adjust the frame/field rate stored in the video\n"
|
||||
" bitstream to match the track's default duration.\n"
|
||||
msgstr ""
|
||||
" --forced-track <TID[:bool]>\n"
|
||||
" '強制表示'フラグをこのトラックに設定します。\n"
|
||||
" boolに0が指定された場合はフラグを設定しません。\n"
|
||||
" --fix-bitstream-timing-information <TID[:bool]>\n"
|
||||
" トラックのデフォルトの継続時間に合うように\n"
|
||||
" ビデオビットストリームのフレーム・フィールドレート\n"
|
||||
" を調整します。\n"
|
||||
|
||||
#: src/merge/mkvmerge.cpp:205
|
||||
msgid ""
|
||||
@ -381,36 +381,34 @@ msgstr ""
|
||||
" ファイルを分割します。\n"
|
||||
|
||||
#: src/merge/mkvmerge.cpp:131
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
" --split chapters:all|A[,B...]\n"
|
||||
" Create a new file before each chapter (with 'all')\n"
|
||||
" or before chapter numbers A, B etc.\n"
|
||||
msgstr ""
|
||||
" --split timecodes:A[,B...]\n"
|
||||
" 各タイムコード、A、B等の後にファイルを分割します。\n"
|
||||
" --split chapters:all|A[,B...]\n"
|
||||
" 各チャプタ(allの場合)またはチャプタ番号A、B\n"
|
||||
" のところでファイルを分割します。\n"
|
||||
|
||||
#: src/merge/mkvmerge.cpp:128
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
" --split frames:A[,B...]\n"
|
||||
" Create a new file after each frame/field A, B\n"
|
||||
" etc.\n"
|
||||
msgstr ""
|
||||
" --split timecodes:A[,B...]\n"
|
||||
" 各タイムコード、A、B等の後にファイルを分割します。\n"
|
||||
" A、B等の各フレーム・フィールドの後でファイルを\n"
|
||||
" 分割します。\n"
|
||||
|
||||
#: src/merge/mkvmerge.cpp:125
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
" --split parts-frames:start1-end1[,[+]start2-end2,...]\n"
|
||||
" Same as 'parts:', but 'startN'/'endN' are frame/\n"
|
||||
" field numbers instead of timecodes.\n"
|
||||
msgstr ""
|
||||
" --split parts:start1-end1[,[+]start2-end2,...]\n"
|
||||
" ファイルを分割するか、'+'の接頭辞が付いている場合は\n"
|
||||
" 前の範囲のファイルに追加結合して、start-endの\n"
|
||||
" タイムコードの範囲を保持します。\n"
|
||||
" --split parts-frames:start1-end1[,[+]start2-end2,...]\n"
|
||||
" 'parts:'と同じですが、'startN'・'endN'は\n"
|
||||
" タイムコードではなくフレーム・フィールド番号です。\n"
|
||||
|
||||
#: src/merge/mkvmerge.cpp:121
|
||||
msgid ""
|
||||
@ -431,7 +429,7 @@ msgid ""
|
||||
" etc.\n"
|
||||
msgstr ""
|
||||
" --split timecodes:A[,B...]\n"
|
||||
" 各タイムコード、A、B等の後にファイルを分割します。\n"
|
||||
" A、B等の各タイムコードの後でファイルを分割します。\n"
|
||||
|
||||
#: src/merge/mkvmerge.cpp:134
|
||||
msgid " --split-max-files <n> Create at most n files.\n"
|
||||
@ -1512,9 +1510,8 @@ msgid "'--engage' lacks its argument.\n"
|
||||
msgstr "'--engage'にパラメータがありません。\n"
|
||||
|
||||
#: src/merge/mkvmerge.cpp:2332
|
||||
#, fuzzy
|
||||
msgid "'--fix-bitstream-timing-information' lacks its argument.\n"
|
||||
msgstr "'--default-duration'にパラメータがありません。\n"
|
||||
msgstr "'--fix-bitstream-timing-information'に引数がありません。\n"
|
||||
|
||||
#: src/merge/mkvmerge.cpp:2224
|
||||
msgid "'--forced-track' lacks its argument.\n"
|
||||
@ -2512,9 +2509,9 @@ msgid "Chapter files (*.xml;*.txt;*.cue)|*.xml;*.txt;*.cue|%s"
|
||||
msgstr "チャプタファイル (*.xml;*.txt;*.cue)|*.xml;*.txt;*.cue|%s"
|
||||
|
||||
#: src/mmg/tabs/chapters.cpp:561
|
||||
#, fuzzy, c-format, boost-format
|
||||
#, c-format, boost-format
|
||||
msgid "Chapter files (*.xml;*.txt;*.mka;*.mkv;*.mks;*.mk3d;*.cue)|*.xml;*.txt;*.mka;*.mkv;*.mks;*.mk3d;*.cue|%s"
|
||||
msgstr "チャプタファイル (*.xml;*.txt;*.mka;*.mkv;*.mk3d;*.cue)|*.xml;*.txt;*.mka;*.mkv;*.mk3d;*.cue|%s"
|
||||
msgstr "チャプタファイル (*.xml;*.txt;*.mka;*.mkv;*.mks;*.mk3d;*.cue)|*.xml;*.txt;*.mka;*.mkv;*.mks;*.mk3d;*.cue|%s"
|
||||
|
||||
#: src/mmg/tabs/chapters.cpp:366
|
||||
msgid "Chapter names and languages"
|
||||
@ -3781,9 +3778,8 @@ msgid "Finished processing on %s"
|
||||
msgstr "%sの処理が終了しました"
|
||||
|
||||
#: src/mmg/tabs/input_format.cpp:260
|
||||
#, fuzzy
|
||||
msgid "Fix bitstream timing information"
|
||||
msgstr "情報の保存中にエラーが発生しました"
|
||||
msgstr "ビットストリームのタイミング情報を修復する"
|
||||
|
||||
#: src/mmg/tabs/chapters.cpp:354
|
||||
msgid "Flags:"
|
||||
@ -4224,9 +4220,9 @@ msgid "Invalid boolean option specified in '--default-track %1%'.\n"
|
||||
msgstr "'--default-track %1%'で無効なブール型が指定されました。\n"
|
||||
|
||||
#: src/merge/mkvmerge.cpp:1415
|
||||
#, fuzzy, boost-format
|
||||
#, boost-format
|
||||
msgid "Invalid boolean option specified in '--fix-bitstream-timing-information %1%'.\n"
|
||||
msgstr "'--forced-track %1%'で無効なブール型が指定されました。\n"
|
||||
msgstr "'--fix-bitstream-timing-information %1%'で無効なブール型が指定されました。\n"
|
||||
|
||||
#: src/merge/mkvmerge.cpp:1067
|
||||
#, boost-format
|
||||
@ -4245,9 +4241,9 @@ msgstr "'%1% %2%'での変更の仕様(%3%)は無効です。\n"
|
||||
|
||||
#: src/merge/mkvmerge.cpp:854
|
||||
#: src/merge/mkvmerge.cpp:893
|
||||
#, fuzzy, boost-format
|
||||
#, boost-format
|
||||
msgid "Invalid chapter number '%1%' for '--split' in '--split %2%': %3%\n"
|
||||
msgstr "'--split %1%'で無効な'--split'フォーマットが指定されました。\n"
|
||||
msgstr "'--split %2%'の'%1%'は無効な'--split'のチャプタ番号が指定されました:%3%\n"
|
||||
|
||||
#: src/merge/mkvmerge.cpp:1122
|
||||
#, boost-format
|
||||
@ -4279,14 +4275,14 @@ msgid "Invalid data for Base64 encoding found."
|
||||
msgstr "Base64エンコーディングには無効なデータが見つかりました。"
|
||||
|
||||
#: src/common/split_arg_parsing.cpp:66
|
||||
#, fuzzy, boost-format
|
||||
#, boost-format
|
||||
msgid "Invalid end frame/field number for '--split' in '--split %1%' (current part: %2%).\n"
|
||||
msgstr "'--split %1%'(現在の部分:%2%)で無効な'--split'の開始点/終了点が指定されました。\n"
|
||||
msgstr "'--split %1%'(現在の部分:%2%)で無効な'--split'の終了フレーム・フィールド番号が指定されました。\n"
|
||||
|
||||
#: src/common/split_arg_parsing.cpp:70
|
||||
#, fuzzy, boost-format
|
||||
#, boost-format
|
||||
msgid "Invalid end frame/field number for '--split' in '--split %1%' (current part: %2%). The end number must be bigger than the start number.\n"
|
||||
msgstr "'--split %1%'(現在の部分:%2%)で'--split'としては無効な終了点の時間が見つかりました。終了点の時間は開始点の時間より大きくなければなりません。\n"
|
||||
msgstr "'--split %1%'(現在の部分:%2%)で'--split'としては無効な終了点のフレーム・フィールド番号が指定されました。終了点の番号は開始点の番号より大きくなければなりません。\n"
|
||||
|
||||
#: src/common/split_arg_parsing.cpp:63
|
||||
#, boost-format
|
||||
@ -4327,14 +4323,12 @@ msgid "Invalid format used for the end time for '%s'. Setting value to 0."
|
||||
msgstr "'%s'の終了時間に使用されているフォーマットが無効です。値を0に設定します。"
|
||||
|
||||
#: src/mmg/tabs/chapters.cpp:1374
|
||||
#, fuzzy
|
||||
msgid "Invalid format used for the segment UID. Not using the value."
|
||||
msgstr "'%s'の終了時間に使用されているフォーマットが無効です。値を0に設定します。"
|
||||
msgstr "セグメントUIDに使用されているフォーマットが無効です。この値は使用しません。"
|
||||
|
||||
#: src/mmg/tabs/chapters.cpp:1392
|
||||
#, fuzzy
|
||||
msgid "Invalid format used for the segment edition UID. Not using the value."
|
||||
msgstr "'%s'の終了時間に使用されているフォーマットが無効です。値を0に設定します。"
|
||||
msgstr "セグメントエディションUIDに使用されているフォーマットが無効です。この値は使用しません。"
|
||||
|
||||
#: src/mmg/tabs/chapters.cpp:1333
|
||||
#, c-format, boost-format
|
||||
@ -4379,9 +4373,9 @@ msgid "Invalid format: unknown character '%1%' found"
|
||||
msgstr "無効なフォーマットです:未知の文字'%1%'が見つかりました"
|
||||
|
||||
#: src/merge/mkvmerge.cpp:834
|
||||
#, fuzzy, boost-format
|
||||
#, boost-format
|
||||
msgid "Invalid frame for '--split' in '--split %1%'.\n"
|
||||
msgstr "'--split %1%'で無効な'--split'フォーマットが指定されました。\n"
|
||||
msgstr "'--split %1%'で'--split'としては無効なフレームが指定されました。\n"
|
||||
|
||||
#: src/input/r_vobsub.cpp:530
|
||||
#, boost-format
|
||||
@ -4437,14 +4431,14 @@ msgid "Invalid split size in '--split %1%'.\n"
|
||||
msgstr "'--split %1%'で無効な分割サイズがあります。\n"
|
||||
|
||||
#: src/common/split_arg_parsing.cpp:56
|
||||
#, fuzzy, boost-format
|
||||
#, boost-format
|
||||
msgid "Invalid start frame/field number for '--split' in '--split %1%' (current part: %2%).\n"
|
||||
msgstr "'--split %1%'(現在の部分:%2%)で無効な'--split'の開始点/終了点が指定されました。\n"
|
||||
msgstr "'--split %1%'(現在の部分:%2%)で'--split'としては無効な開始点のフレーム・フィールド番号が指定されました。\n"
|
||||
|
||||
#: src/common/split_arg_parsing.cpp:77
|
||||
#, fuzzy, boost-format
|
||||
#, boost-format
|
||||
msgid "Invalid start frame/field number for '--split' in '--split %1%' (current part: %2%). The start number must be bigger than or equal to the previous part's end number.\n"
|
||||
msgstr "'--split %1%'(現在の部分:%2%)で'--split'としては無効な終了点の時間が見つかりました。開始点の時間は前の部分の終了点の時間以上でなければなりません。。\n"
|
||||
msgstr "'--split %1%'(現在の部分:%2%)で'--split'としては無効な開始点のフレーム・フィールド番号が指定されました。開始点の番号は直前部分の終了点の番号以上でなければなりません。\n"
|
||||
|
||||
#: src/input/r_usf.cpp:207
|
||||
msgid "Invalid start or stop timecode"
|
||||
@ -4552,9 +4546,9 @@ msgid "Invalid track ID specified in '--default-track %1%'.\n"
|
||||
msgstr "'--default-track %1%'で無効なトラックIDが指定されました。\n"
|
||||
|
||||
#: src/merge/mkvmerge.cpp:1409
|
||||
#, fuzzy, boost-format
|
||||
#, boost-format
|
||||
msgid "Invalid track ID specified in '--fix-bitstream-timing-information %1%'.\n"
|
||||
msgstr "'--forced-track %1%'で無効なトラックIDが指定されました。\n"
|
||||
msgstr "'--fix-bitstream-timing-information %1%'で無効なトラックIDが指定されました。\n"
|
||||
|
||||
#: src/merge/mkvmerge.cpp:1061
|
||||
#, boost-format
|
||||
@ -5211,7 +5205,7 @@ msgstr "修正されたヘッダのフィールドはありません。何も保
|
||||
|
||||
#: src/mmg/tabs/input_format.cpp:261
|
||||
msgid "Normally mkvmerge does not change the timing information (frame/field rate) stored in the video bitstream. With this option that information is adjusted to match the container timing information. The container timing information can come from various sources: from the command line via --default-duration, the source container or derived from the bitstream."
|
||||
msgstr ""
|
||||
msgstr "通常、mkvmergeはビデオビットストリームに格納されているタイミング情報(フレーム・フィールドレート)を変更しません。このオプションを指定すると、その情報はコンテナのタイミング情報に合うように調節されます。コンテナのタイミング情報は、次のような様々なソースから得ることができます:コマンドラインから--default-durationを通じて、ソースコンテナ、ビットストリームから取得"
|
||||
|
||||
#: src/mmg/cli_options_dlg.cpp:144
|
||||
msgid "Normally mkvmerge keeps aspect ratio information in MPEG4 video bitstreams and puts the information into the container. This option causes mkvmerge to remove the aspect ratio information from the bitstream."
|
||||
@ -6234,7 +6228,7 @@ msgstr "トラックの横解像度を指定します。縦も同様に指定さ
|
||||
|
||||
#: src/mmg/options/mkvmerge.cpp:57
|
||||
msgid "Sets the priority that mkvmerge will run with. Chosing 'lowest' will cause mkvmerge to select a low I/O priority as well."
|
||||
msgstr ""
|
||||
msgstr "mkvmergeが走る優先度を設定します。'lowest'を選択すると、mkvmergeにそれに加えて低いI/O優先度も選択させることができます。"
|
||||
|
||||
#: src/mmg/tabs/global.cpp:331
|
||||
msgid ""
|
||||
@ -6956,7 +6950,7 @@ msgstr "editで指定された'%1%'と'%2%'はUID %3%の同じトラックに解
|
||||
|
||||
#: src/mmg/tabs/chapters.cpp:353
|
||||
msgid "The edition UID to play from the segment linked in the chapter's segment UID. This is simply a number."
|
||||
msgstr ""
|
||||
msgstr "チャプタのセグメントUIDに紐付けられているセグメントから再生するべきエディションUIDです。これは単なる数字を指定します。"
|
||||
|
||||
#: src/mmg/header_editor/frame.cpp:660
|
||||
#: src/mmg/tabs/chapters.cpp:1688
|
||||
@ -7082,9 +7076,8 @@ msgstr "このファイルはサポートされていないコンテナフォー
|
||||
|
||||
#: src/mmg/wx_kax_analyzer.cpp:36
|
||||
#: src/propedit/propedit.cpp:94
|
||||
#, fuzzy
|
||||
msgid "The file is being analyzed."
|
||||
msgstr "ファイルを解析します。\n"
|
||||
msgstr "ファイルを解析中です。"
|
||||
|
||||
#: src/merge/output_control.cpp:282
|
||||
msgid "The file is being fixed, part 1/4..."
|
||||
@ -7146,7 +7139,7 @@ msgstr "追加されたファイルはプレイリストです。このファイ
|
||||
#: src/common/kax_file.cpp:48
|
||||
#, boost-format
|
||||
msgid "The first cluster timecode after the resync is %1%.\n"
|
||||
msgstr ""
|
||||
msgstr "再同期後最初のクラスタのタイムコードは%1%です。\n"
|
||||
|
||||
#: src/merge/mkvmerge.cpp:1755
|
||||
msgid "The first file cannot be appended because there are no files to append to.\n"
|
||||
@ -7262,7 +7255,7 @@ msgstr "言語コード'%1%'は有効なISO639-2言語コードではないの
|
||||
#: src/common/kax_file.cpp:197
|
||||
#, boost-format
|
||||
msgid "The last timecode processed before the error was encountered was %1%.\n"
|
||||
msgstr ""
|
||||
msgstr "エラーに遭遇する前に処理された最後のタイムコードは%1%でした。\n"
|
||||
|
||||
#: src/merge/timecode_factory.cpp:213
|
||||
#, boost-format
|
||||
@ -7711,7 +7704,7 @@ msgstr "このAVC/h.264トラックはキーフレームで始まっていませ
|
||||
|
||||
#: src/output/p_avc.cpp:126
|
||||
msgid "This AVC/h.264 track's timing information indicates that it uses a variable frame rate. However, no default duration nor an external timecode file has been provided for it, nor does the source container provide timecodes. The resulting timecodes may not be useful.\n"
|
||||
msgstr ""
|
||||
msgstr "このAVC・h.264トラックのタイミング情報は、可変フレームレートを使用していることを示しています。しかし、そのためのデフォルトの継続時間や外部んぼタイムコードファイルが提供されておらず、ソースコンテナもタイムコードを提供していません。その結果生成されるタイムコードは役に立たない可能性があります。\n"
|
||||
|
||||
#: src/output/p_mp3.cpp:58
|
||||
#, boost-format
|
||||
@ -8454,7 +8447,7 @@ msgstr "VobSubインデックスファイル'%1%'を書き込んでいます。\
|
||||
|
||||
#: src/mmg/tabs/chapters.cpp:1677
|
||||
msgid "Writing to the file failed. Typical reasons include the file being write-protected, locked by another process or you not having write permissions for the target directory."
|
||||
msgstr ""
|
||||
msgstr "ファイルへの書き込みが失敗しました。ファイルが書き込み保護されていたり、他のプロセスによってロックされていたり、ターゲットディレクトリの書き込み権限が無いということが典型的な原因として挙げられます。"
|
||||
|
||||
#: src/common/kate.cpp:59
|
||||
#, boost-format
|
||||
@ -10412,4 +10405,3 @@ msgstr "はい"
|
||||
|
||||
#~ msgid "wrong usage: writing to read-only memory"
|
||||
#~ msgstr "間違った使用法:読み込み専用メモリへの書き込み"
|
||||
|
||||
|
335
po/zh_TW.po
335
po/zh_TW.po
File diff suppressed because it is too large
Load Diff
@ -209,6 +209,11 @@ public:
|
||||
return memory_cptr(new memory_c(static_cast<unsigned char *>(safememdup(buffer, size)), size, true));
|
||||
}
|
||||
|
||||
static inline memory_cptr
|
||||
clone(std::string const &buffer) {
|
||||
return clone(buffer.c_str(), buffer.length());
|
||||
}
|
||||
|
||||
private:
|
||||
struct counter {
|
||||
X *ptr;
|
||||
|
@ -764,24 +764,21 @@ mpeg4::p10::parse_pps(memory_cptr &buffer,
|
||||
This function searches a buffer containing the MPEG4 layer 10 (AVC) codec
|
||||
initialization for the pixel aspectc ratio. If it is found then the
|
||||
numerator and the denominator are returned, and the aspect ratio
|
||||
information is removed from the buffer. The new buffer is returned
|
||||
in the variable \c buffer, and the new size is returned in \c buffer_size.
|
||||
information is removed from the buffer. The new buffer is returned.
|
||||
|
||||
\param buffer The buffer containing the MPEG4 layer 10 codec data.
|
||||
\param buffer_size The size of the buffer in bytes.
|
||||
\param par_num The numerator, if found, is stored in this variable.
|
||||
\param par_den The denominator, if found, is stored in this variable.
|
||||
|
||||
\return \c true if the pixel aspect ratio was found and \c false
|
||||
otherwise.
|
||||
\return The new buffer. If the pixel aspect ratio was not found
|
||||
then both \c par_num and \c par_den are set to 0.
|
||||
*/
|
||||
bool
|
||||
mpeg4::p10::extract_par(uint8_t *&buffer,
|
||||
size_t &buffer_size,
|
||||
memory_cptr
|
||||
mpeg4::p10::extract_par(memory_cptr const &buffer,
|
||||
uint32_t &par_num,
|
||||
uint32_t &par_den) {
|
||||
try {
|
||||
auto avcc = avcc_c::unpack(memory_cptr{new memory_c{buffer, buffer_size, false}});
|
||||
auto avcc = avcc_c::unpack(buffer);
|
||||
auto new_avcc = avcc;
|
||||
par_num = 1;
|
||||
par_den = 1;
|
||||
@ -812,25 +809,28 @@ mpeg4::p10::extract_par(uint8_t *&buffer,
|
||||
}
|
||||
|
||||
auto packed_new_avcc = new_avcc.pack();
|
||||
if (packed_new_avcc) {
|
||||
buffer_size = packed_new_avcc->get_size();
|
||||
buffer = packed_new_avcc->get_buffer();
|
||||
packed_new_avcc->lock();
|
||||
|
||||
if (!ar_found) {
|
||||
par_num = 0;
|
||||
par_den = 0;
|
||||
}
|
||||
|
||||
return ar_found;
|
||||
return packed_new_avcc;
|
||||
|
||||
} catch(...) {
|
||||
return false;
|
||||
par_num = 0;
|
||||
par_den = 0;
|
||||
|
||||
return buffer;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
mpeg4::p10::fix_sps_fps(uint8_t *&buffer,
|
||||
size_t &buffer_size,
|
||||
memory_cptr
|
||||
mpeg4::p10::fix_sps_fps(memory_cptr const &buffer,
|
||||
int64_t duration) {
|
||||
try {
|
||||
mm_mem_io_c avcc(buffer, buffer_size), new_avcc(nullptr, buffer_size, 1024);
|
||||
auto buffer_size = buffer->get_size();
|
||||
mm_mem_io_c avcc(buffer->get_buffer(), buffer->get_size()), new_avcc(nullptr, buffer_size, 1024);
|
||||
memory_cptr nalu(new memory_c());
|
||||
|
||||
avcc.read(nalu, 5);
|
||||
@ -867,10 +867,10 @@ mpeg4::p10::fix_sps_fps(uint8_t *&buffer,
|
||||
new_avcc.write(nalu);
|
||||
}
|
||||
|
||||
buffer_size = new_avcc.getFilePointer();
|
||||
buffer = new_avcc.get_and_lock_buffer();
|
||||
return memory_cptr{new memory_c{new_avcc.get_and_lock_buffer(), new_avcc.getFilePointer()}};
|
||||
|
||||
} catch(...) {
|
||||
return memory_cptr{};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -142,8 +142,8 @@ void rbsp_to_nalu(memory_cptr &buffer);
|
||||
bool parse_sps(memory_cptr &buffer, sps_info_t &sps, bool keep_ar_info = false, bool fix_bitstream_frame_rate = false, int64_t duration = -1);
|
||||
bool parse_pps(memory_cptr &buffer, pps_info_t &pps);
|
||||
|
||||
bool extract_par(uint8_t *&buffer, size_t &buffer_size, uint32_t &par_num, uint32_t &par_den);
|
||||
void fix_sps_fps(uint8_t *&buffer, size_t &buffer_size, int64_t duration);
|
||||
memory_cptr extract_par(memory_cptr const &buffer, uint32_t &par_num, uint32_t &par_den);
|
||||
memory_cptr fix_sps_fps(memory_cptr const &buffer, int64_t duration);
|
||||
bool is_avc_fourcc(const char *fourcc);
|
||||
memory_cptr avcc_to_nalus(const unsigned char *buffer, size_t size);
|
||||
|
||||
|
@ -342,7 +342,7 @@ mpeg4::p2::find_frame_types(const unsigned char *buffer,
|
||||
\return \c nullptr if no configuration data was found and a pointer to
|
||||
a memory_c object otherwise. This object has to be deleted manually.
|
||||
*/
|
||||
memory_c *
|
||||
memory_cptr
|
||||
mpeg4::p2::parse_config_data(const unsigned char *buffer,
|
||||
int buffer_size,
|
||||
mpeg4::p2::config_data_t &config_data) {
|
||||
@ -389,16 +389,16 @@ mpeg4::p2::parse_config_data(const unsigned char *buffer,
|
||||
} catch (...) {
|
||||
}
|
||||
|
||||
memory_c *mem;
|
||||
memory_cptr mem;
|
||||
if (-1 == vos_offset) {
|
||||
mem = new memory_c((unsigned char *)safemalloc(size + 5), size + 5, true);
|
||||
mem = memory_c::alloc(size + 5);
|
||||
unsigned char *dst = mem->get_buffer();
|
||||
put_uint32_be(dst, MPEGVIDEO_VOS_START_CODE);
|
||||
dst[4] = 0xf5;
|
||||
memcpy(dst + 5, buffer, size);
|
||||
|
||||
} else {
|
||||
mem = new memory_c((unsigned char *)safemalloc(size), size, true);
|
||||
mem = memory_c::alloc(size);
|
||||
unsigned char *dst = mem->get_buffer();
|
||||
put_uint32_be(dst, MPEGVIDEO_VOS_START_CODE);
|
||||
if (3 >= buffer[vos_offset + 4])
|
||||
|
@ -132,7 +132,7 @@ namespace mpeg4 {
|
||||
bool extract_par(const unsigned char *buffer, int buffer_size, uint32_t &par_num, uint32_t &par_den);
|
||||
bool extract_size(const unsigned char *buffer, int buffer_size, uint32_t &width, uint32_t &height);
|
||||
void find_frame_types(const unsigned char *buffer, int buffer_size, std::vector<video_frame_t> &frames, const config_data_t &config_data);
|
||||
memory_c * parse_config_data(const unsigned char *buffer, int buffer_size, config_data_t &config_data);
|
||||
memory_cptr parse_config_data(const unsigned char *buffer, int buffer_size, config_data_t &config_data);
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "common/mpeg1_2.h"
|
||||
#include "common/mpeg4_p2.h"
|
||||
#include "common/mpeg4_p10.h"
|
||||
#include "common/strings/formatting.h"
|
||||
#include "input/r_avi.h"
|
||||
#include "input/subtitles.h"
|
||||
#include "merge/output_control.h"
|
||||
@ -123,8 +124,6 @@ avi_reader_c::~avi_reader_c() {
|
||||
if (m_avi)
|
||||
AVI_close(m_avi);
|
||||
|
||||
m_ti.m_private_data = nullptr;
|
||||
|
||||
mxverb(2, boost::format("avi_reader_c: Dropped video frames: %1%\n") % m_dropped_video_frames);
|
||||
}
|
||||
|
||||
@ -204,6 +203,8 @@ avi_reader_c::parse_subtitle_chunks() {
|
||||
|
||||
void
|
||||
avi_reader_c::create_packetizer(int64_t tid) {
|
||||
m_ti.m_private_data.reset();
|
||||
|
||||
if ((0 == tid) && demuxing_requested('v', 0) && (-1 == m_vptzr) && m_video_track_ok)
|
||||
create_video_packetizer();
|
||||
|
||||
@ -222,16 +223,13 @@ avi_reader_c::create_video_packetizer() {
|
||||
mxverb(4, boost::format(" %1%: %2%\n") % i % AVI_frame_size(m_avi, i));
|
||||
}
|
||||
|
||||
m_ti.m_private_data = reinterpret_cast<unsigned char *>(m_avi->bitmap_info_header);
|
||||
if (m_ti.m_private_data)
|
||||
m_ti.m_private_size = get_uint32_le(&m_avi->bitmap_info_header->bi_size);
|
||||
if (m_avi->bitmap_info_header) {
|
||||
m_ti.m_private_data = memory_c::clone(m_avi->bitmap_info_header, get_uint32_le(&m_avi->bitmap_info_header->bi_size));
|
||||
|
||||
mxverb(4, boost::format("track extra data size: %1%\n") % (m_ti.m_private_size - sizeof(alBITMAPINFOHEADER)));
|
||||
if (sizeof(alBITMAPINFOHEADER) < m_ti.m_private_size) {
|
||||
mxverb(4, " ");
|
||||
for (i = sizeof(alBITMAPINFOHEADER); i < m_ti.m_private_size; ++i)
|
||||
mxverb(4, boost::format("%|1$02x| ") % m_ti.m_private_data[i]);
|
||||
mxverb(4, "\n");
|
||||
mxverb(4, boost::format("track extra data size: %1%\n") % (m_ti.m_private_data->get_size() - sizeof(alBITMAPINFOHEADER)));
|
||||
|
||||
if (sizeof(alBITMAPINFOHEADER) < m_ti.m_private_data->get_size())
|
||||
mxverb(4, boost::format(" %1%\n") % to_hex(m_ti.m_private_data->get_buffer() + sizeof(alBITMAPINFOHEADER), m_ti.m_private_data->get_size() - sizeof(alBITMAPINFOHEADER)));
|
||||
}
|
||||
|
||||
const char *codec = AVI_video_compressor(m_avi);
|
||||
@ -268,8 +266,8 @@ avi_reader_c::create_mpeg1_2_packetizer() {
|
||||
std::shared_ptr<M2VParser> m2v_parser(new M2VParser);
|
||||
|
||||
m2v_parser->SetProbeMode();
|
||||
if ((0 != m_ti.m_private_size) && (m_ti.m_private_size < sizeof(alBITMAPINFOHEADER)))
|
||||
m2v_parser->WriteData(m_ti.m_private_data + sizeof(alBITMAPINFOHEADER), m_ti.m_private_size - sizeof(alBITMAPINFOHEADER));
|
||||
if (m_ti.m_private_data && (m_ti.m_private_data->get_size() < sizeof(alBITMAPINFOHEADER)))
|
||||
m2v_parser->WriteData(m_ti.m_private_data->get_buffer() + sizeof(alBITMAPINFOHEADER), m_ti.m_private_data->get_size() - sizeof(alBITMAPINFOHEADER));
|
||||
|
||||
unsigned int frame_number = 0;
|
||||
unsigned int state = m2v_parser->GetState();
|
||||
@ -307,13 +305,10 @@ avi_reader_c::create_mpeg1_2_packetizer() {
|
||||
int display_width = ((0 >= seq_hdr.aspectRatio) || (1 == seq_hdr.aspectRatio)) ? seq_hdr.width : static_cast<int>(seq_hdr.height * seq_hdr.aspectRatio);
|
||||
|
||||
MPEGChunk *raw_seq_hdr = m2v_parser->GetRealSequenceHeader();
|
||||
if (raw_seq_hdr) {
|
||||
m_ti.m_private_data = raw_seq_hdr->GetPointer();
|
||||
m_ti.m_private_size = raw_seq_hdr->GetSize();
|
||||
} else {
|
||||
m_ti.m_private_data = nullptr;
|
||||
m_ti.m_private_size = 0;
|
||||
}
|
||||
if (raw_seq_hdr)
|
||||
m_ti.m_private_data = memory_c::clone(raw_seq_hdr->GetPointer(), raw_seq_hdr->GetSize());
|
||||
else
|
||||
m_ti.m_private_data.reset();
|
||||
|
||||
m_vptzr = add_packetizer(new mpeg1_2_video_packetizer_c(this, m_ti, m2v_parser->GetMPEGVersion(), seq_hdr.frameOrFieldRate,
|
||||
seq_hdr.width, seq_hdr.height, display_width, seq_hdr.height, false));
|
||||
@ -357,9 +352,8 @@ avi_reader_c::create_mpeg4_p10_packetizer() {
|
||||
|
||||
void
|
||||
avi_reader_c::create_vp8_packetizer() {
|
||||
m_ti.m_private_data = nullptr;
|
||||
m_ti.m_private_size = 0;
|
||||
m_vptzr = add_packetizer(new vp8_video_packetizer_c(this, m_ti));
|
||||
m_ti.m_private_data.reset();
|
||||
m_vptzr = add_packetizer(new vp8_video_packetizer_c(this, m_ti));
|
||||
|
||||
PTZR(m_vptzr)->set_track_default_duration(1000000000ll / m_fps);
|
||||
PTZR(m_vptzr)->set_video_pixel_width(AVI_video_width(m_avi));
|
||||
@ -393,6 +387,7 @@ avi_reader_c::create_subs_packetizer(int idx) {
|
||||
if (!demuxing_requested('s', 1 + AVI_audio_tracks(m_avi) + idx))
|
||||
return;
|
||||
|
||||
m_ti.m_private_data.reset();
|
||||
avi_subs_demuxer_t &demuxer = m_subtitle_demuxers[idx];
|
||||
|
||||
demuxer.m_text_io = mm_text_io_cptr(new mm_text_io_c(new mm_mem_io_c(demuxer.m_subtitles->get_buffer(), demuxer.m_subtitles->get_size())));
|
||||
@ -415,7 +410,7 @@ avi_reader_c::create_srt_packetizer(int idx) {
|
||||
parser->parse();
|
||||
|
||||
bool is_utf8 = demuxer.m_text_io->get_byte_order() != BO_NONE;
|
||||
demuxer.m_ptzr = add_packetizer(new textsubs_packetizer_c(this, m_ti, MKV_S_TEXTUTF8, nullptr, 0, true, is_utf8));
|
||||
demuxer.m_ptzr = add_packetizer(new textsubs_packetizer_c(this, m_ti, MKV_S_TEXTUTF8, true, is_utf8));
|
||||
|
||||
show_packetizer_info(id, PTZR(demuxer.m_ptzr));
|
||||
}
|
||||
@ -437,8 +432,8 @@ avi_reader_c::create_ssa_packetizer(int idx) {
|
||||
parser->set_attachment_id_base(g_attachments.size());
|
||||
parser->parse();
|
||||
|
||||
std::string global = parser->get_global();
|
||||
demuxer.m_ptzr = add_packetizer(new textsubs_packetizer_c(this, m_ti, parser->is_ass() ? MKV_S_TEXTASS : MKV_S_TEXTSSA, global.c_str(), global.length(), false, false));
|
||||
m_ti.m_private_data = memory_c::clone(parser->get_global());
|
||||
demuxer.m_ptzr = add_packetizer(new textsubs_packetizer_c(this, m_ti, parser->is_ass() ? MKV_S_TEXTASS : MKV_S_TEXTSSA, false, false));
|
||||
|
||||
show_packetizer_info(id, PTZR(demuxer.m_ptzr));
|
||||
}
|
||||
@ -477,13 +472,11 @@ avi_reader_c::add_audio_demuxer(int aid) {
|
||||
alWAVEFORMATEXTENSIBLE *ext = reinterpret_cast<alWAVEFORMATEXTENSIBLE *>(wfe);
|
||||
audio_format = get_uint32_le(&ext->extension.guid.data1);
|
||||
|
||||
} else if (get_uint16_le(&wfe->cb_size) > 0) {
|
||||
m_ti.m_private_data = reinterpret_cast<unsigned char *>(wfe + 1);
|
||||
m_ti.m_private_size = get_uint16_le(&wfe->cb_size);
|
||||
} else {
|
||||
m_ti.m_private_data = nullptr;
|
||||
m_ti.m_private_size = 0;
|
||||
}
|
||||
} else if (get_uint16_le(&wfe->cb_size) > 0)
|
||||
m_ti.m_private_data = memory_c::clone(wfe + 1, get_uint16_le(&wfe->cb_size));
|
||||
|
||||
else
|
||||
m_ti.m_private_data.reset();
|
||||
|
||||
switch(audio_format) {
|
||||
case 0x0001: // raw PCM audio
|
||||
@ -537,9 +530,9 @@ avi_reader_c::create_aac_packetizer(int aid,
|
||||
bool aac_data_created = false;
|
||||
bool headerless = (AVI_audio_format(m_avi) != 0x706d);
|
||||
|
||||
if ((0 == m_ti.m_private_size)
|
||||
if (!m_ti.m_private_data
|
||||
|| ( (0x706d == AVI_audio_format(m_avi))
|
||||
&& ((sizeof(alWAVEFORMATEX) + 7) < m_ti.m_private_size))) {
|
||||
&& ((sizeof(alWAVEFORMATEX) + 7) < m_ti.m_private_data->get_size()))) {
|
||||
aac_data_created = true;
|
||||
channels = AVI_audio_channels(m_avi);
|
||||
sample_rate = AVI_audio_rate(m_avi);
|
||||
@ -554,12 +547,11 @@ avi_reader_c::create_aac_packetizer(int aid,
|
||||
}
|
||||
|
||||
unsigned char created_aac_data[AAC_MAX_PRIVATE_DATA_SIZE];
|
||||
|
||||
m_ti.m_private_size = create_aac_data(created_aac_data, profile, channels, sample_rate, output_sample_rate, is_sbr);
|
||||
m_ti.m_private_data = created_aac_data;
|
||||
auto size = create_aac_data(created_aac_data, profile, channels, sample_rate, output_sample_rate, is_sbr);
|
||||
m_ti.m_private_data = memory_c::clone(created_aac_data, size);
|
||||
|
||||
} else {
|
||||
if (!parse_aac_data(m_ti.m_private_data, m_ti.m_private_size, profile, channels, sample_rate, output_sample_rate, is_sbr))
|
||||
if (!parse_aac_data(m_ti.m_private_data->get_buffer(), m_ti.m_private_data->get_size(), profile, channels, sample_rate, output_sample_rate, is_sbr))
|
||||
mxerror_tid(m_ti.m_fname, aid + 1, Y("This AAC track does not contain valid headers. Could not parse the AAC information.\n"));
|
||||
|
||||
if (is_sbr)
|
||||
@ -574,11 +566,6 @@ avi_reader_c::create_aac_packetizer(int aid,
|
||||
if (is_sbr)
|
||||
packetizer->set_audio_output_sampling_freq(output_sample_rate);
|
||||
|
||||
if (aac_data_created) {
|
||||
m_ti.m_private_size = 0;
|
||||
m_ti.m_private_data = nullptr;
|
||||
}
|
||||
|
||||
return packetizer;
|
||||
}
|
||||
|
||||
@ -625,16 +612,16 @@ avi_reader_c::create_dts_packetizer(int aid) {
|
||||
generic_packetizer_c *
|
||||
avi_reader_c::create_vorbis_packetizer(int aid) {
|
||||
try {
|
||||
if (!m_ti.m_private_data || !m_ti.m_private_size)
|
||||
if (m_ti.m_private_data)
|
||||
throw mtx::input::extended_x(Y("Invalid Vorbis headers in AVI audio track."));
|
||||
|
||||
unsigned char *c = m_ti.m_private_data;
|
||||
auto c = m_ti.m_private_data->get_buffer();
|
||||
|
||||
if (2 != c[0])
|
||||
throw mtx::input::extended_x(Y("Invalid Vorbis headers in AVI audio track."));
|
||||
|
||||
int offset = 1;
|
||||
const int laced_size = m_ti.m_private_size;
|
||||
const int laced_size = m_ti.m_private_data->get_size();
|
||||
int i;
|
||||
|
||||
int header_sizes[3];
|
||||
@ -660,8 +647,7 @@ avi_reader_c::create_vorbis_packetizer(int aid) {
|
||||
headers[2] = &c[offset + header_sizes[0] + header_sizes[1]];
|
||||
header_sizes[2] = laced_size - offset - header_sizes[0] - header_sizes[1];
|
||||
|
||||
m_ti.m_private_data = nullptr;
|
||||
m_ti.m_private_size = 0;
|
||||
m_ti.m_private_data.reset();
|
||||
|
||||
return new vorbis_packetizer_c(this, m_ti, headers[0], header_sizes[0], headers[1], header_sizes[1], headers[2], header_sizes[2]);
|
||||
|
||||
|
@ -311,6 +311,7 @@ flv_reader_c::create_packetizer(int64_t id) {
|
||||
return;
|
||||
|
||||
m_ti.m_id = id;
|
||||
m_ti.m_private_data.reset();
|
||||
|
||||
if (track->m_fourcc.equiv("AVC1"))
|
||||
create_v_avc_packetizer(track);
|
||||
@ -327,15 +328,9 @@ flv_reader_c::create_packetizer(int64_t id) {
|
||||
|
||||
void
|
||||
flv_reader_c::create_v_avc_packetizer(flv_track_cptr &track) {
|
||||
if (track->m_private_data) {
|
||||
m_ti.m_private_data = track->m_private_data->get_buffer();
|
||||
m_ti.m_private_size = track->m_private_data->get_size();
|
||||
}
|
||||
|
||||
track->m_ptzr = add_packetizer(new mpeg4_p10_video_packetizer_c(this, m_ti, track->m_v_frame_rate, track->m_v_width, track->m_v_height));
|
||||
m_ti.m_private_data = track->m_private_data;
|
||||
track->m_ptzr = add_packetizer(new mpeg4_p10_video_packetizer_c(this, m_ti, track->m_v_frame_rate, track->m_v_width, track->m_v_height));
|
||||
show_packetizer_info(m_video_track_idx, PTZR(track->m_ptzr));
|
||||
|
||||
m_ti.m_private_data = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
@ -351,13 +346,10 @@ flv_reader_c::create_v_generic_packetizer(flv_track_cptr &track) {
|
||||
put_uint32_le(&bih.bi_size_image, track->m_v_width * track->m_v_height * 3);
|
||||
track->m_fourcc.write(reinterpret_cast<unsigned char *>(&bih.bi_compression));
|
||||
|
||||
m_ti.m_private_data = reinterpret_cast<unsigned char *>(&bih);
|
||||
m_ti.m_private_size = sizeof(bih);
|
||||
m_ti.m_private_data = memory_c::clone(&bih, sizeof(bih));
|
||||
|
||||
track->m_ptzr = add_packetizer(new video_packetizer_c(this, m_ti, MKV_V_MSCOMP, track->m_v_frame_rate, track->m_v_width, track->m_v_height));
|
||||
show_packetizer_info(m_video_track_idx, PTZR(track->m_ptzr));
|
||||
|
||||
m_ti.m_private_data = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1261,7 +1261,7 @@ kax_reader_c::init_passthrough_packetizer(kax_track_t *t) {
|
||||
|
||||
ptzr->set_track_type(MAP_TRACK_TYPE(t->type));
|
||||
ptzr->set_codec_id(t->codec_id);
|
||||
ptzr->set_codec_private(static_cast<const unsigned char *>(t->private_data), t->private_size);
|
||||
ptzr->set_codec_private(memory_c::clone(t->private_data, t->private_size));
|
||||
|
||||
if (0.0 < t->v_frate)
|
||||
ptzr->set_track_default_duration(1000000000.0 / t->v_frate);
|
||||
@ -1469,9 +1469,7 @@ kax_reader_c::create_dts_audio_packetizer(kax_track_t *t,
|
||||
void
|
||||
kax_reader_c::create_flac_audio_packetizer(kax_track_t *t,
|
||||
track_info_c &nti) {
|
||||
safefree(nti.m_private_data);
|
||||
nti.m_private_data = nullptr;
|
||||
nti.m_private_size = 0;
|
||||
nti.m_private_data.reset();
|
||||
|
||||
if (FOURCC('f', 'L', 'a', 'C') == t->a_formattag)
|
||||
set_track_packetizer(t, new flac_packetizer_c(this, nti, static_cast<unsigned char *>(t->private_data), t->private_size));
|
||||
@ -1493,7 +1491,7 @@ kax_reader_c::create_mp3_audio_packetizer(kax_track_t *t,
|
||||
void
|
||||
kax_reader_c::create_opus_audio_packetizer(kax_track_t *t,
|
||||
track_info_c &nti) {
|
||||
set_track_packetizer(t, new opus_packetizer_c(this, nti, memory_c::clone(t->private_data, t->private_size)));
|
||||
set_track_packetizer(t, new opus_packetizer_c(this, nti));
|
||||
show_packetizer_info(t->tnum, t->ptzr_ptr);
|
||||
}
|
||||
|
||||
@ -1507,10 +1505,7 @@ kax_reader_c::create_pcm_audio_packetizer(kax_track_t *t,
|
||||
void
|
||||
kax_reader_c::create_tta_audio_packetizer(kax_track_t *t,
|
||||
track_info_c &nti) {
|
||||
safefree(nti.m_private_data);
|
||||
nti.m_private_data = nullptr;
|
||||
nti.m_private_size = 0;
|
||||
|
||||
nti.m_private_data.reset();
|
||||
set_track_packetizer(t, new tta_packetizer_c(this, nti, t->a_channels, t->a_bps, t->a_sfreq));
|
||||
show_packetizer_info(t->tnum, t->ptzr_ptr);
|
||||
}
|
||||
@ -1525,11 +1520,9 @@ kax_reader_c::create_vorbis_audio_packetizer(kax_track_t *t,
|
||||
void
|
||||
kax_reader_c::create_wavpack_audio_packetizer(kax_track_t *t,
|
||||
track_info_c &nti) {
|
||||
nti.m_private_data.reset();
|
||||
|
||||
wavpack_meta_t meta;
|
||||
|
||||
nti.m_private_data = static_cast<unsigned char *>(t->private_data);
|
||||
nti.m_private_size = t->private_size;
|
||||
|
||||
meta.bits_per_sample = t->a_bps;
|
||||
meta.channel_count = t->a_channels;
|
||||
meta.sample_rate = t->a_sfreq;
|
||||
@ -1539,8 +1532,6 @@ kax_reader_c::create_wavpack_audio_packetizer(kax_track_t *t,
|
||||
meta.samples_per_block = t->a_sfreq / t->v_frate;
|
||||
|
||||
set_track_packetizer(t, new wavpack_packetizer_c(this, nti, meta));
|
||||
nti.m_private_data = nullptr;
|
||||
nti.m_private_size = 0;
|
||||
|
||||
show_packetizer_info(t->tnum, t->ptzr_ptr);
|
||||
}
|
||||
@ -1594,7 +1585,7 @@ void
|
||||
kax_reader_c::create_subtitle_packetizer(kax_track_t *t,
|
||||
track_info_c &nti) {
|
||||
if (t->codec_id == MKV_S_VOBSUB) {
|
||||
set_track_packetizer(t, new vobsub_packetizer_c(this, t->private_data, t->private_size, nti));
|
||||
set_track_packetizer(t, new vobsub_packetizer_c(this, nti));
|
||||
show_packetizer_info(t->tnum, t->ptzr_ptr);
|
||||
|
||||
t->sub_type = 'v';
|
||||
@ -1602,13 +1593,13 @@ kax_reader_c::create_subtitle_packetizer(kax_track_t *t,
|
||||
} else if (balg::starts_with(t->codec_id, "S_TEXT") || (t->codec_id == "S_SSA") || (t->codec_id == "S_ASS")) {
|
||||
std::string new_codec_id = ((t->codec_id == "S_SSA") || (t->codec_id == "S_ASS")) ? std::string("S_TEXT/") + std::string(&t->codec_id[2]) : t->codec_id;
|
||||
|
||||
set_track_packetizer(t, new textsubs_packetizer_c(this, nti, new_codec_id.c_str(), t->private_data, t->private_size, false, true));
|
||||
set_track_packetizer(t, new textsubs_packetizer_c(this, nti, new_codec_id.c_str(), false, true));
|
||||
show_packetizer_info(t->tnum, t->ptzr_ptr);
|
||||
|
||||
t->sub_type = 't';
|
||||
|
||||
} else if (t->codec_id == MKV_S_KATE) {
|
||||
set_track_packetizer(t, new kate_packetizer_c(this, nti, t->private_data, t->private_size));
|
||||
set_track_packetizer(t, new kate_packetizer_c(this, nti));
|
||||
show_packetizer_info(t->tnum, t->ptzr_ptr);
|
||||
t->sub_type = 'k';
|
||||
|
||||
@ -1625,17 +1616,16 @@ kax_reader_c::create_subtitle_packetizer(kax_track_t *t,
|
||||
void
|
||||
kax_reader_c::create_button_packetizer(kax_track_t *t,
|
||||
track_info_c &nti) {
|
||||
if (t->codec_id == MKV_B_VOBBTN) {
|
||||
safefree(nti.m_private_data);
|
||||
nti.m_private_data = nullptr;
|
||||
nti.m_private_size = 0;
|
||||
t->sub_type = 'b';
|
||||
|
||||
set_track_packetizer(t, new vobbtn_packetizer_c(this, nti, t->v_width, t->v_height));
|
||||
show_packetizer_info(t->tnum, t->ptzr_ptr);
|
||||
|
||||
} else
|
||||
if (t->codec_id != MKV_B_VOBBTN) {
|
||||
init_passthrough_packetizer(t);
|
||||
return;
|
||||
}
|
||||
|
||||
nti.m_private_data.reset();
|
||||
t->sub_type = 'b';
|
||||
|
||||
set_track_packetizer(t, new vobbtn_packetizer_c(this, nti, t->v_width, t->v_height));
|
||||
show_packetizer_info(t->tnum, t->ptzr_ptr);
|
||||
}
|
||||
|
||||
void
|
||||
@ -1646,8 +1636,7 @@ kax_reader_c::create_packetizer(int64_t tid) {
|
||||
return;
|
||||
|
||||
track_info_c nti(m_ti);
|
||||
nti.m_private_data = safememdup(t->private_data, t->private_size);
|
||||
nti.m_private_size = t->private_size;
|
||||
nti.m_private_data = memory_c::clone(t->private_data, t->private_size);
|
||||
nti.m_id = t->tnum; // ID for this track.
|
||||
|
||||
if (nti.m_language == "")
|
||||
@ -1715,7 +1704,7 @@ kax_reader_c::create_mpeg4_p10_es_video_packetizer(kax_track_t *t,
|
||||
void
|
||||
kax_reader_c::create_mpeg4_p10_video_packetizer(kax_track_t *t,
|
||||
track_info_c &nti) {
|
||||
if ((0 == nti.m_private_size) || !nti.m_private_data) {
|
||||
if (!nti.m_private_data || !nti.m_private_data->get_size()) {
|
||||
// avc_es_parser_cptr parser = parse_first_mpeg4_p10_frame(t, nti);
|
||||
create_mpeg4_p10_es_video_packetizer(t, nti);
|
||||
return;
|
||||
|
@ -150,10 +150,10 @@ mpeg_es_reader_c::read_headers() {
|
||||
dheight = height;
|
||||
|
||||
MPEGChunk *raw_seq_hdr = parser.GetRealSequenceHeader();
|
||||
if (raw_seq_hdr) {
|
||||
m_ti.m_private_data = (unsigned char *)safememdup(raw_seq_hdr->GetPointer(), raw_seq_hdr->GetSize());
|
||||
m_ti.m_private_size = raw_seq_hdr->GetSize();
|
||||
}
|
||||
if (raw_seq_hdr)
|
||||
m_ti.m_private_data = memory_c::clone(raw_seq_hdr->GetPointer(), raw_seq_hdr->GetSize());
|
||||
else
|
||||
m_ti.m_private_data.reset();
|
||||
|
||||
mxverb(2, boost::format("mpeg_es_reader: version %1% width %2% height %3% FPS %4% AR %5%\n") % version % width % height % frame_rate % aspect_ratio);
|
||||
|
||||
|
@ -1128,8 +1128,11 @@ mpeg_ps_reader_c::create_packetizer(int64_t id) {
|
||||
if (!demuxing_requested(tracks[id]->type, id))
|
||||
return;
|
||||
|
||||
m_ti.m_private_data.reset();
|
||||
m_ti.m_id = id;
|
||||
mpeg_ps_track_ptr &track = tracks[id];
|
||||
|
||||
auto &track = tracks[id];
|
||||
|
||||
if ('a' == track->type) {
|
||||
if ( (FOURCC('M', 'P', '1', ' ') == track->fourcc)
|
||||
|| (FOURCC('M', 'P', '2', ' ') == track->fourcc)
|
||||
@ -1157,15 +1160,12 @@ mpeg_ps_reader_c::create_packetizer(int64_t id) {
|
||||
|| (FOURCC('M', 'P', 'G', '2') == track->fourcc)) {
|
||||
generic_packetizer_c *m2vpacketizer;
|
||||
|
||||
m_ti.m_private_data = track->raw_seq_hdr;
|
||||
m_ti.m_private_size = track->raw_seq_hdr_size;
|
||||
m_ti.m_private_data = memory_c::clone(track->raw_seq_hdr, track->raw_seq_hdr_size);
|
||||
m2vpacketizer = new mpeg1_2_video_packetizer_c(this, m_ti, track->v_version, track->v_frame_rate, track->v_width, track->v_height,
|
||||
track->v_dwidth, track->v_dheight, false);
|
||||
track->ptzr = add_packetizer(m2vpacketizer);
|
||||
show_packetizer_info(id, PTZR(track->ptzr));
|
||||
m2vpacketizer->set_video_interlaced_flag(track->v_interlaced);
|
||||
m_ti.m_private_data = nullptr;
|
||||
m_ti.m_private_size = 0;
|
||||
|
||||
} else if (track->fourcc == FOURCC('A', 'V', 'C', '1')) {
|
||||
track->ptzr = add_packetizer(new mpeg4_p10_es_video_packetizer_c(this, m_ti));
|
||||
|
@ -1149,21 +1149,11 @@ mpeg_ts_reader_c::create_packetizer(int64_t id) {
|
||||
|
||||
void
|
||||
mpeg_ts_reader_c::create_mpeg1_2_video_packetizer(mpeg_ts_track_ptr &track) {
|
||||
m_ti.m_private_data = track->raw_seq_hdr;
|
||||
auto m2vpacketizer = new mpeg1_2_video_packetizer_c(this, m_ti, track->v_version, track->v_frame_rate, track->v_width, track->v_height, track->v_dwidth, track->v_dheight, false);
|
||||
track->ptzr = add_packetizer(m2vpacketizer);
|
||||
|
||||
if (track->raw_seq_hdr && (0 < track->raw_seq_hdr->get_size())) {
|
||||
m_ti.m_private_data = track->raw_seq_hdr->get_buffer();
|
||||
m_ti.m_private_size = track->raw_seq_hdr->get_size();
|
||||
} else {
|
||||
m_ti.m_private_data = nullptr;
|
||||
m_ti.m_private_size = 0;
|
||||
}
|
||||
|
||||
generic_packetizer_c *m2vpacketizer = new mpeg1_2_video_packetizer_c(this, m_ti, track->v_version, track->v_frame_rate, track->v_width, track->v_height,
|
||||
track->v_dwidth, track->v_dheight, false);
|
||||
track->ptzr = add_packetizer(m2vpacketizer);
|
||||
show_packetizer_info(m_ti.m_id, PTZR(track->ptzr));
|
||||
m_ti.m_private_data = nullptr;
|
||||
m_ti.m_private_size = 0;
|
||||
m2vpacketizer->set_video_interlaced_flag(track->v_interlaced);
|
||||
}
|
||||
|
||||
|
@ -420,8 +420,7 @@ ogm_reader_c::create_packetizer(int64_t tid) {
|
||||
if (!dmx->in_use)
|
||||
return;
|
||||
|
||||
m_ti.m_private_data = nullptr;
|
||||
m_ti.m_private_size = 0;
|
||||
m_ti.m_private_data.reset();
|
||||
m_ti.m_id = tid;
|
||||
m_ti.m_language = dmx->language;
|
||||
m_ti.m_track_name = dmx->title;
|
||||
@ -1104,7 +1103,8 @@ ogm_a_opus_demuxer_c::ogm_a_opus_demuxer_c(ogm_reader_c *p_reader)
|
||||
|
||||
generic_packetizer_c *
|
||||
ogm_a_opus_demuxer_c::create_packetizer() {
|
||||
auto ptzr_obj = new opus_packetizer_c(reader, m_ti, packet_data[0]);
|
||||
m_ti.m_private_data = packet_data[0];
|
||||
auto ptzr_obj = new opus_packetizer_c(reader, m_ti);
|
||||
|
||||
show_packetizer_info(m_ti.m_id, ptzr_obj);
|
||||
|
||||
@ -1135,7 +1135,7 @@ ogm_s_text_demuxer_c::ogm_s_text_demuxer_c(ogm_reader_c *p_reader)
|
||||
|
||||
generic_packetizer_c *
|
||||
ogm_s_text_demuxer_c::create_packetizer() {
|
||||
generic_packetizer_c *ptzr_obj = new textsubs_packetizer_c(reader, m_ti, MKV_S_TEXTUTF8, nullptr, 0, true, false);
|
||||
generic_packetizer_c *ptzr_obj = new textsubs_packetizer_c(reader, m_ti, MKV_S_TEXTUTF8, true, false);
|
||||
|
||||
show_packetizer_info(m_ti.m_id, ptzr_obj);
|
||||
|
||||
@ -1177,9 +1177,6 @@ ogm_v_avc_demuxer_c::ogm_v_avc_demuxer_c(ogm_reader_c *p_reader)
|
||||
generic_packetizer_c *
|
||||
ogm_v_avc_demuxer_c::create_packetizer() {
|
||||
stream_header *sth = (stream_header *)&packet_data[0]->get_buffer()[1];
|
||||
|
||||
m_ti.m_private_data = nullptr;
|
||||
m_ti.m_private_size = 0;
|
||||
generic_packetizer_c *vptzr = new mpeg4_p10_es_video_packetizer_c(reader, m_ti);
|
||||
|
||||
vptzr->set_video_pixel_dimensions(get_uint32_le(&sth->sh.video.width), get_uint32_le(&sth->sh.video.height));
|
||||
@ -1235,8 +1232,7 @@ ogm_v_mscomp_demuxer_c::create_packetizer() {
|
||||
put_uint32_le(&bih.bi_size_image, get_uint32_le(&bih.bi_width) * get_uint32_le(&bih.bi_height) * 3);
|
||||
memcpy(&bih.bi_compression, sth->subtype, 4);
|
||||
|
||||
m_ti.m_private_data = (unsigned char *)&bih;
|
||||
m_ti.m_private_size = sizeof(alBITMAPINFOHEADER);
|
||||
m_ti.m_private_data = memory_c::clone(&bih, sizeof(alBITMAPINFOHEADER));
|
||||
|
||||
double fps = (double)10000000.0 / get_uint64_le(&sth->time_unit);
|
||||
int width = get_uint32_le(&sth->sh.video.width);
|
||||
@ -1250,8 +1246,6 @@ ogm_v_mscomp_demuxer_c::create_packetizer() {
|
||||
|
||||
show_packetizer_info(m_ti.m_id, ptzr_obj);
|
||||
|
||||
m_ti.m_private_data = nullptr;
|
||||
|
||||
return ptzr_obj;
|
||||
}
|
||||
|
||||
@ -1328,17 +1322,13 @@ ogm_v_theora_demuxer_c::initialize() {
|
||||
|
||||
generic_packetizer_c *
|
||||
ogm_v_theora_demuxer_c::create_packetizer() {
|
||||
memory_cptr codecprivate = lace_memory_xiph(packet_data);
|
||||
m_ti.m_private_data = codecprivate->get_buffer();
|
||||
m_ti.m_private_size = codecprivate->get_size();
|
||||
m_ti.m_private_data = lace_memory_xiph(packet_data);
|
||||
|
||||
double fps = (double)theora.frn / (double)theora.frd;
|
||||
generic_packetizer_c *ptzr_obj = new theora_video_packetizer_c(reader, m_ti, fps, theora.fmbw, theora.fmbh);
|
||||
|
||||
show_packetizer_info(m_ti.m_id, ptzr_obj);
|
||||
|
||||
m_ti.m_private_data = nullptr;
|
||||
|
||||
return ptzr_obj;
|
||||
}
|
||||
|
||||
@ -1498,16 +1488,11 @@ ogm_s_kate_demuxer_c::initialize() {
|
||||
|
||||
generic_packetizer_c *
|
||||
ogm_s_kate_demuxer_c::create_packetizer() {
|
||||
memory_cptr codecprivate = lace_memory_xiph(packet_data);
|
||||
m_ti.m_private_data = codecprivate->get_buffer();
|
||||
m_ti.m_private_size = codecprivate->get_size();
|
||||
|
||||
generic_packetizer_c *ptzr_obj = new kate_packetizer_c(reader, m_ti, m_ti.m_private_data, m_ti.m_private_size);
|
||||
m_ti.m_private_data = lace_memory_xiph(packet_data);
|
||||
auto ptzr_obj = new kate_packetizer_c(reader, m_ti);
|
||||
|
||||
show_packetizer_info(m_ti.m_id, ptzr_obj);
|
||||
|
||||
m_ti.m_private_data = nullptr;
|
||||
|
||||
return ptzr_obj;
|
||||
}
|
||||
|
||||
|
@ -155,7 +155,6 @@ qtmp4_reader_c::read_headers() {
|
||||
}
|
||||
|
||||
qtmp4_reader_c::~qtmp4_reader_c() {
|
||||
m_ti.m_private_data = nullptr;
|
||||
}
|
||||
|
||||
qt_atom_t
|
||||
@ -1229,25 +1228,16 @@ qtmp4_reader_c::create_audio_packetizer_alac(qtmp4_demuxer_cptr &dmx) {
|
||||
|
||||
void
|
||||
qtmp4_reader_c::create_video_packetizer_svq1(qtmp4_demuxer_cptr &dmx) {
|
||||
memory_cptr bih(create_bitmap_info_header(dmx, "SVQ1"));
|
||||
|
||||
m_ti.m_private_size = bih->get_size();
|
||||
m_ti.m_private_data = (unsigned char *)bih->get_buffer();
|
||||
|
||||
dmx->ptzr = add_packetizer(new video_packetizer_c(this, m_ti, MKV_V_MSCOMP, 0.0, dmx->v_width, dmx->v_height));
|
||||
m_ti.m_private_data = nullptr;
|
||||
m_ti.m_private_data = create_bitmap_info_header(dmx, "SVQ1");
|
||||
dmx->ptzr = add_packetizer(new video_packetizer_c(this, m_ti, MKV_V_MSCOMP, 0.0, dmx->v_width, dmx->v_height));
|
||||
|
||||
show_packetizer_info(dmx->id, PTZR(dmx->ptzr));
|
||||
}
|
||||
|
||||
void
|
||||
qtmp4_reader_c::create_video_packetizer_mpeg4_p2(qtmp4_demuxer_cptr &dmx) {
|
||||
memory_cptr bih(create_bitmap_info_header(dmx, "DIVX"));
|
||||
|
||||
m_ti.m_private_size = bih->get_size();
|
||||
m_ti.m_private_data = (unsigned char *)bih->get_buffer();
|
||||
dmx->ptzr = add_packetizer(new mpeg4_p2_video_packetizer_c(this, m_ti, 0.0, dmx->v_width, dmx->v_height, false));
|
||||
m_ti.m_private_data = nullptr;
|
||||
m_ti.m_private_data = create_bitmap_info_header(dmx, "DIVX");
|
||||
dmx->ptzr = add_packetizer(new mpeg4_p2_video_packetizer_c(this, m_ti, 0.0, dmx->v_width, dmx->v_height, false));
|
||||
|
||||
show_packetizer_info(dmx->id, PTZR(dmx->ptzr));
|
||||
}
|
||||
@ -1270,34 +1260,24 @@ qtmp4_reader_c::create_video_packetizer_mpeg4_p10(qtmp4_demuxer_cptr &dmx) {
|
||||
"As it is missing the timecodes for this track might be wrong. "
|
||||
"You should watch the resulting file and make sure that it looks like you expected it to.\n"));
|
||||
|
||||
m_ti.m_private_size = dmx->priv->get_size();
|
||||
m_ti.m_private_data = dmx->priv->get_buffer();
|
||||
dmx->ptzr = add_packetizer(new mpeg4_p10_video_packetizer_c(this, m_ti, dmx->fps, dmx->v_width, dmx->v_height));
|
||||
m_ti.m_private_data = nullptr;
|
||||
m_ti.m_private_data = dmx->priv;
|
||||
dmx->ptzr = add_packetizer(new mpeg4_p10_video_packetizer_c(this, m_ti, dmx->fps, dmx->v_width, dmx->v_height));
|
||||
|
||||
show_packetizer_info(dmx->id, PTZR(dmx->ptzr));
|
||||
}
|
||||
|
||||
void
|
||||
qtmp4_reader_c::create_video_packetizer_standard(qtmp4_demuxer_cptr &dmx) {
|
||||
m_ti.m_private_size = dmx->stsd->get_size();
|
||||
m_ti.m_private_data = dmx->stsd->get_buffer();
|
||||
m_ti.m_private_data = dmx->stsd;
|
||||
dmx->ptzr = add_packetizer(new video_packetizer_c(this, m_ti, MKV_V_QUICKTIME, 0.0, dmx->v_width, dmx->v_height));
|
||||
m_ti.m_private_data = nullptr;
|
||||
|
||||
show_packetizer_info(dmx->id, PTZR(dmx->ptzr));
|
||||
}
|
||||
|
||||
void
|
||||
qtmp4_reader_c::create_audio_packetizer_aac(qtmp4_demuxer_cptr &dmx) {
|
||||
if (dmx->esds.decoder_config) {
|
||||
m_ti.m_private_data = dmx->esds.decoder_config->get_buffer();
|
||||
m_ti.m_private_size = dmx->esds.decoder_config->get_size();
|
||||
}
|
||||
|
||||
m_ti.m_private_data = dmx->esds.decoder_config;
|
||||
dmx->ptzr = add_packetizer(new aac_packetizer_c(this, m_ti, AAC_ID_MPEG4, dmx->a_aac_profile, (int)dmx->a_samplerate, dmx->a_channels, false, true));
|
||||
m_ti.m_private_data = nullptr;
|
||||
m_ti.m_private_size = 0;
|
||||
|
||||
if (dmx->a_aac_is_sbr)
|
||||
PTZR(dmx->ptzr)->set_audio_output_sampling_freq(dmx->a_aac_output_sample_rate);
|
||||
@ -1324,7 +1304,7 @@ qtmp4_reader_c::create_audio_packetizer_passthrough(qtmp4_demuxer_cptr &dmx) {
|
||||
|
||||
ptzr->set_track_type(track_audio);
|
||||
ptzr->set_codec_id(MKV_A_QUICKTIME);
|
||||
ptzr->set_codec_private(dmx->stsd->get_buffer(), dmx->stsd->get_size());
|
||||
ptzr->set_codec_private(dmx->stsd);
|
||||
ptzr->set_audio_sampling_freq(dmx->a_samplerate);
|
||||
ptzr->set_audio_channels(dmx->a_channels);
|
||||
|
||||
@ -1408,7 +1388,8 @@ qtmp4_reader_c::create_subtitles_packetizer_vobsub(qtmp4_demuxer_cptr &dmx) {
|
||||
|
||||
mxdebug_if(m_debug_headers, boost::format("VobSub IDX str:\n%1%") % idx_str);
|
||||
|
||||
dmx->ptzr = add_packetizer(new vobsub_packetizer_c(this, idx_str.c_str(), idx_str.length(), m_ti));
|
||||
m_ti.m_private_data = memory_c::clone(idx_str);
|
||||
dmx->ptzr = add_packetizer(new vobsub_packetizer_c(this, m_ti));
|
||||
show_packetizer_info(dmx->id, PTZR(dmx->ptzr));
|
||||
}
|
||||
|
||||
@ -1428,6 +1409,7 @@ qtmp4_reader_c::create_packetizer(int64_t tid) {
|
||||
|
||||
m_ti.m_id = dmx->id;
|
||||
m_ti.m_language = dmx->language;
|
||||
m_ti.m_private_data.reset();
|
||||
|
||||
bool packetizer_ok = true;
|
||||
|
||||
|
@ -251,14 +251,9 @@ real_reader_c::parse_headers() {
|
||||
|
||||
void
|
||||
real_reader_c::create_video_packetizer(real_demuxer_cptr dmx) {
|
||||
if (dmx->private_data) {
|
||||
m_ti.m_private_data = dmx->private_data->get_buffer();
|
||||
m_ti.m_private_size = dmx->private_data->get_size();
|
||||
}
|
||||
|
||||
m_ti.m_private_data = dmx->private_data;
|
||||
std::string codec_id = (boost::format("V_REAL/%1%") % dmx->fourcc).str();
|
||||
dmx->ptzr = add_packetizer(new video_packetizer_c(this, m_ti, codec_id.c_str(), 0.0, dmx->width, dmx->height));
|
||||
m_ti.m_private_data = nullptr;
|
||||
|
||||
if (strcmp(dmx->fourcc, "RV40"))
|
||||
dmx->rv_dimensions = true;
|
||||
@ -361,7 +356,8 @@ real_reader_c::create_audio_packetizer(real_demuxer_cptr dmx) {
|
||||
if (!strcasecmp(dmx->fourcc, "COOK"))
|
||||
dmx->cook_audio_fix = true;
|
||||
|
||||
dmx->ptzr = add_packetizer(new ra_packetizer_c(this, m_ti, dmx->samples_per_second, dmx->channels, dmx->bits_per_sample, get_uint32_be(dmx->fourcc), dmx->private_data));
|
||||
m_ti.m_private_data = dmx->private_data;
|
||||
dmx->ptzr = add_packetizer(new ra_packetizer_c(this, m_ti, dmx->samples_per_second, dmx->channels, dmx->bits_per_sample, get_uint32_be(dmx->fourcc)));
|
||||
|
||||
show_packetizer_info(dmx->track->id, PTZR(dmx->ptzr));
|
||||
}
|
||||
@ -379,6 +375,7 @@ real_reader_c::create_packetizer(int64_t tid) {
|
||||
|
||||
rmff_track_t *track = dmx->track;
|
||||
m_ti.m_id = track->id;
|
||||
m_ti.m_private_data.reset();
|
||||
|
||||
if (RMFF_TRACK_TYPE_VIDEO == track->type)
|
||||
create_video_packetizer(dmx);
|
||||
|
@ -57,7 +57,7 @@ srt_reader_c::create_packetizer(int64_t) {
|
||||
return;
|
||||
|
||||
bool is_utf8 = m_text_in->get_byte_order() != BO_NONE;
|
||||
add_packetizer(new textsubs_packetizer_c(this, m_ti, MKV_S_TEXTUTF8, nullptr, 0, true, is_utf8));
|
||||
add_packetizer(new textsubs_packetizer_c(this, m_ti, MKV_S_TEXTUTF8, true, is_utf8));
|
||||
|
||||
show_packetizer_info(0, PTZR0);
|
||||
}
|
||||
|
@ -69,8 +69,8 @@ ssa_reader_c::create_packetizer(int64_t) {
|
||||
if (!demuxing_requested('s', 0) || (NPTZR() != 0))
|
||||
return;
|
||||
|
||||
std::string global = m_subs->get_global();
|
||||
add_packetizer(new textsubs_packetizer_c(this, m_ti, m_subs->is_ass() ? MKV_S_TEXTASS : MKV_S_TEXTSSA, global.c_str(), global.length(), false, false));
|
||||
m_ti.m_private_data = memory_c::clone(m_subs->get_global());
|
||||
add_packetizer(new textsubs_packetizer_c(this, m_ti, m_subs->is_ass() ? MKV_S_TEXTASS : MKV_S_TEXTSSA, false, false));
|
||||
show_packetizer_info(0, PTZR0);
|
||||
}
|
||||
|
||||
|
@ -154,8 +154,9 @@ usf_reader_c::create_packetizer(int64_t tid) {
|
||||
if (!demuxing_requested('s', tid) || (-1 != track->m_ptzr))
|
||||
return;
|
||||
|
||||
m_ti.m_language = track->m_language;
|
||||
track->m_ptzr = add_packetizer(new textsubs_packetizer_c(this, m_ti, MKV_S_TEXTUSF, m_private_data.c_str(), m_private_data.length(), false, true));
|
||||
m_ti.m_private_data = memory_c::clone(m_private_data);
|
||||
m_ti.m_language = track->m_language;
|
||||
track->m_ptzr = add_packetizer(new textsubs_packetizer_c(this, m_ti, MKV_S_TEXTUSF, false, true));
|
||||
show_packetizer_info(tid, PTZR(track->m_ptzr));
|
||||
}
|
||||
|
||||
|
@ -127,7 +127,8 @@ vobsub_reader_c::create_packetizer(int64_t tid) {
|
||||
vobsub_track_c *track = tracks[tid];
|
||||
m_ti.m_id = tid;
|
||||
m_ti.m_language = tracks[tid]->language;
|
||||
track->ptzr = add_packetizer(new vobsub_packetizer_c(this, idx_data.c_str(), idx_data.length(), m_ti));
|
||||
m_ti.m_private_data = memory_c::clone(idx_data);
|
||||
track->ptzr = add_packetizer(new vobsub_packetizer_c(this, m_ti));
|
||||
|
||||
int64_t avg_duration;
|
||||
if (!track->entries.empty()) {
|
||||
|
@ -94,12 +94,9 @@ wavpack_reader_c::create_packetizer(int64_t) {
|
||||
if (!demuxing_requested('a', 0) || (NPTZR() != 0))
|
||||
return;
|
||||
|
||||
uint16_t version_le;
|
||||
put_uint16_le(&version_le, header.version);
|
||||
m_ti.m_private_data = (unsigned char *)&version_le;
|
||||
m_ti.m_private_size = sizeof(uint16_t);
|
||||
m_ti.m_private_data = memory_c::alloc(sizeof(uint16_t));
|
||||
put_uint16_le(m_ti.m_private_data->get_buffer(), header.version);
|
||||
add_packetizer(new wavpack_packetizer_c(this, m_ti, meta));
|
||||
m_ti.m_private_data = nullptr;
|
||||
|
||||
show_packetizer_info(0, PTZR0);
|
||||
}
|
||||
|
65
src/merge/connection_checks.h
Normal file
65
src/merge/connection_checks.h
Normal file
@ -0,0 +1,65 @@
|
||||
/*
|
||||
mkvmerge -- utility for splicing together matroska files
|
||||
from component media subtypes
|
||||
|
||||
Distributed under the GPL
|
||||
see the file COPYING for details
|
||||
or visit http://www.gnu.org/copyleft/gpl.html
|
||||
|
||||
connection_check* macros
|
||||
|
||||
Written by Moritz Bunkus <moritz@bunkus.org>.
|
||||
*/
|
||||
|
||||
#ifndef MTX_MERGE_CONNECTION_CHECKS_H
|
||||
#define MTX_MERGE_CONNECTION_CHECKS_H
|
||||
|
||||
#define connect_check_a_samplerate(a, b) \
|
||||
if ((a) != (b)) { \
|
||||
error_message = (boost::format(Y("The sample rate of the two audio tracks is different: %1% and %2%")) % (a) % (b)).str(); \
|
||||
return CAN_CONNECT_NO_PARAMETERS; \
|
||||
}
|
||||
#define connect_check_a_channels(a, b) \
|
||||
if ((a) != (b)) { \
|
||||
error_message = (boost::format(Y("The number of channels of the two audio tracks is different: %1% and %2%")) % (a) % (b)).str(); \
|
||||
return CAN_CONNECT_NO_PARAMETERS; \
|
||||
}
|
||||
#define connect_check_a_bitdepth(a, b) \
|
||||
if ((a) != (b)) { \
|
||||
error_message = (boost::format(Y("The number of bits per sample of the two audio tracks is different: %1% and %2%")) % (a) % (b)).str(); \
|
||||
return CAN_CONNECT_NO_PARAMETERS; \
|
||||
}
|
||||
#define connect_check_v_width(a, b) \
|
||||
if ((a) != (b)) { \
|
||||
error_message = (boost::format(Y("The width of the two tracks is different: %1% and %2%")) % (a) % (b)).str(); \
|
||||
return CAN_CONNECT_NO_PARAMETERS; \
|
||||
}
|
||||
#define connect_check_v_height(a, b) \
|
||||
if ((a) != (b)) { \
|
||||
error_message = (boost::format(Y("The height of the two tracks is different: %1% and %2%")) % (a) % (b)).str(); \
|
||||
return CAN_CONNECT_NO_PARAMETERS; \
|
||||
}
|
||||
#define connect_check_v_dwidth(a, b) \
|
||||
if ((a) != (b)) { \
|
||||
error_message = (boost::format(Y("The display width of the two tracks is different: %1% and %2%")) % (a) % (b)).str(); \
|
||||
return CAN_CONNECT_NO_PARAMETERS; \
|
||||
}
|
||||
#define connect_check_v_dheight(a, b) \
|
||||
if ((a) != (b)) { \
|
||||
error_message = (boost::format(Y("The display height of the two tracks is different: %1% and %2%")) % (a) % (b)).str(); \
|
||||
return CAN_CONNECT_NO_PARAMETERS; \
|
||||
}
|
||||
#define connect_check_codec_id(a, b) \
|
||||
if ((a) != (b)) { \
|
||||
error_message = (boost::format(Y("The CodecID of the two tracks is different: %1% and %2%")) % (a) % (b)).str(); \
|
||||
return CAN_CONNECT_NO_PARAMETERS; \
|
||||
}
|
||||
#define connect_check_codec_private(b) \
|
||||
if ( (!!this->m_ti.m_private_data != !!b->m_ti.m_private_data) \
|
||||
|| ( this->m_ti.m_private_data && ( this->m_ti.m_private_data->get_size() != b->m_ti.m_private_data->get_size())) \
|
||||
|| ( this->m_ti.m_private_data && memcmp(this->m_ti.m_private_data->get_buffer(), b->m_ti.m_private_data->get_buffer(), this->m_ti.m_private_data->get_size()))) { \
|
||||
error_message = (boost::format(Y("The codec's private data does not match (lengths: %1% and %2%).")) % this->m_ti.m_private_data->get_size() % b->m_ti.m_private_data->get_size()).str(); \
|
||||
return CAN_CONNECT_MAYBE_CODECPRIVATE; \
|
||||
}
|
||||
|
||||
#endif // MTX_MERGE_CONNECTION_CHECKS_H
|
@ -72,8 +72,6 @@ generic_packetizer_c::generic_packetizer_c(generic_reader_c *reader,
|
||||
, m_default_track_warning_printed(false)
|
||||
, m_huid(0)
|
||||
, m_htrack_max_add_block_ids(-1)
|
||||
, m_hcodec_private(nullptr)
|
||||
, m_hcodec_private_length(0)
|
||||
, m_haudio_sampling_freq(-1.0)
|
||||
, m_haudio_output_sampling_freq(-1.0)
|
||||
, m_haudio_channels(-1)
|
||||
@ -252,7 +250,6 @@ generic_packetizer_c::generic_packetizer_c(generic_reader_c *reader,
|
||||
}
|
||||
|
||||
generic_packetizer_c::~generic_packetizer_c() {
|
||||
safefree(m_hcodec_private);
|
||||
if (!m_packet_queue.empty())
|
||||
mxerror_tid(m_ti.m_fname, m_ti.m_id, boost::format(Y("Packet queue not empty (flushed: %1%). Frames have been lost during remux. %2%\n")) % m_has_been_flushed % BUGMSG);
|
||||
}
|
||||
@ -344,21 +341,15 @@ generic_packetizer_c::set_codec_id(const std::string &id) {
|
||||
}
|
||||
|
||||
void
|
||||
generic_packetizer_c::set_codec_private(const unsigned char *cp,
|
||||
int length) {
|
||||
safefree(m_hcodec_private);
|
||||
generic_packetizer_c::set_codec_private(memory_cptr const &buffer) {
|
||||
if (buffer && buffer->get_size()) {
|
||||
m_hcodec_private = buffer->clone();
|
||||
|
||||
if (!cp) {
|
||||
m_hcodec_private = nullptr;
|
||||
m_hcodec_private_length = 0;
|
||||
return;
|
||||
}
|
||||
if (m_track_entry)
|
||||
GetChild<KaxCodecPrivate>(*m_track_entry).CopyBuffer(static_cast<binary *>(m_hcodec_private->get_buffer()), m_hcodec_private->get_size());
|
||||
|
||||
m_hcodec_private = (unsigned char *)safememdup(cp, length);
|
||||
m_hcodec_private_length = length;
|
||||
|
||||
if (m_track_entry)
|
||||
GetChild<KaxCodecPrivate>(*m_track_entry).CopyBuffer((binary *)m_hcodec_private, m_hcodec_private_length);
|
||||
} else
|
||||
m_hcodec_private.reset();
|
||||
}
|
||||
|
||||
void
|
||||
@ -634,7 +625,7 @@ generic_packetizer_c::set_headers() {
|
||||
GetChild<KaxCodecID>(m_track_entry).SetValue(m_hcodec_id);
|
||||
|
||||
if (m_hcodec_private)
|
||||
GetChild<KaxCodecPrivate>(*m_track_entry).CopyBuffer((binary *)m_hcodec_private, m_hcodec_private_length);
|
||||
GetChild<KaxCodecPrivate>(*m_track_entry).CopyBuffer(static_cast<binary *>(m_hcodec_private->get_buffer()), m_hcodec_private->get_size());
|
||||
|
||||
if (!outputting_webm()) {
|
||||
if (-1 != m_htrack_min_cache)
|
||||
@ -1528,11 +1519,8 @@ generic_reader_c::get_underlying_input_as_multi_file_io()
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
track_info_c::track_info_c()
|
||||
: m_initialized(true)
|
||||
, m_id(0)
|
||||
: m_id(0)
|
||||
, m_disable_multi_file(false)
|
||||
, m_private_data(nullptr)
|
||||
, m_private_size(0)
|
||||
, m_aspect_ratio(0.0)
|
||||
, m_display_width(0)
|
||||
, m_display_height(0)
|
||||
@ -1562,20 +1550,8 @@ track_info_c::track_info_c()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
track_info_c::free_contents() {
|
||||
if (!m_initialized)
|
||||
return;
|
||||
|
||||
safefree(m_private_data);
|
||||
|
||||
m_initialized = false;
|
||||
}
|
||||
|
||||
track_info_c &
|
||||
track_info_c::operator =(const track_info_c &src) {
|
||||
free_contents();
|
||||
|
||||
m_id = src.m_id;
|
||||
m_fname = src.m_fname;
|
||||
|
||||
@ -1586,8 +1562,7 @@ track_info_c::operator =(const track_info_c &src) {
|
||||
m_track_tags = src.m_track_tags;
|
||||
m_disable_multi_file = src.m_disable_multi_file;
|
||||
|
||||
m_private_size = src.m_private_size;
|
||||
m_private_data = (unsigned char *)safememdup(src.m_private_data, m_private_size);
|
||||
m_private_data = src.m_private_data ? src.m_private_data->clone() : src.m_private_data;
|
||||
|
||||
m_all_fourccs = src.m_all_fourccs;
|
||||
|
||||
@ -1670,8 +1645,6 @@ track_info_c::operator =(const track_info_c &src) {
|
||||
m_default_durations = src.m_default_durations;
|
||||
m_max_blockadd_ids = src.m_max_blockadd_ids;
|
||||
|
||||
m_initialized = true;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -232,8 +232,7 @@ public:
|
||||
bool m_disable_multi_file;
|
||||
|
||||
// Options used by the packetizers.
|
||||
unsigned char *m_private_data;
|
||||
size_t m_private_size;
|
||||
memory_cptr m_private_data;
|
||||
|
||||
std::map<int64_t, std::string> m_all_fourccs;
|
||||
std::string m_fourcc;
|
||||
@ -316,17 +315,13 @@ public:
|
||||
|
||||
public:
|
||||
track_info_c();
|
||||
track_info_c(const track_info_c &src)
|
||||
: m_initialized(false)
|
||||
{
|
||||
track_info_c(const track_info_c &src) {
|
||||
*this = src;
|
||||
}
|
||||
virtual ~track_info_c() {
|
||||
free_contents();
|
||||
}
|
||||
|
||||
track_info_c &operator =(const track_info_c &src);
|
||||
virtual void free_contents();
|
||||
virtual bool display_dimensions_or_aspect_ratio_set();
|
||||
};
|
||||
|
||||
@ -437,53 +432,6 @@ enum connection_result_e {
|
||||
CAN_CONNECT_MAYBE_CODECPRIVATE
|
||||
};
|
||||
|
||||
#define connect_check_a_samplerate(a, b) \
|
||||
if ((a) != (b)) { \
|
||||
error_message = (boost::format(Y("The sample rate of the two audio tracks is different: %1% and %2%")) % (a) % (b)).str(); \
|
||||
return CAN_CONNECT_NO_PARAMETERS; \
|
||||
}
|
||||
#define connect_check_a_channels(a, b) \
|
||||
if ((a) != (b)) { \
|
||||
error_message = (boost::format(Y("The number of channels of the two audio tracks is different: %1% and %2%")) % (a) % (b)).str(); \
|
||||
return CAN_CONNECT_NO_PARAMETERS; \
|
||||
}
|
||||
#define connect_check_a_bitdepth(a, b) \
|
||||
if ((a) != (b)) { \
|
||||
error_message = (boost::format(Y("The number of bits per sample of the two audio tracks is different: %1% and %2%")) % (a) % (b)).str(); \
|
||||
return CAN_CONNECT_NO_PARAMETERS; \
|
||||
}
|
||||
#define connect_check_v_width(a, b) \
|
||||
if ((a) != (b)) { \
|
||||
error_message = (boost::format(Y("The width of the two tracks is different: %1% and %2%")) % (a) % (b)).str(); \
|
||||
return CAN_CONNECT_NO_PARAMETERS; \
|
||||
}
|
||||
#define connect_check_v_height(a, b) \
|
||||
if ((a) != (b)) { \
|
||||
error_message = (boost::format(Y("The height of the two tracks is different: %1% and %2%")) % (a) % (b)).str(); \
|
||||
return CAN_CONNECT_NO_PARAMETERS; \
|
||||
}
|
||||
#define connect_check_v_dwidth(a, b) \
|
||||
if ((a) != (b)) { \
|
||||
error_message = (boost::format(Y("The display width of the two tracks is different: %1% and %2%")) % (a) % (b)).str(); \
|
||||
return CAN_CONNECT_NO_PARAMETERS; \
|
||||
}
|
||||
#define connect_check_v_dheight(a, b) \
|
||||
if ((a) != (b)) { \
|
||||
error_message = (boost::format(Y("The display height of the two tracks is different: %1% and %2%")) % (a) % (b)).str(); \
|
||||
return CAN_CONNECT_NO_PARAMETERS; \
|
||||
}
|
||||
#define connect_check_codec_id(a, b) \
|
||||
if ((a) != (b)) { \
|
||||
error_message = (boost::format(Y("The CodecID of the two tracks is different: %1% and %2%")) % (a) % (b)).str(); \
|
||||
return CAN_CONNECT_NO_PARAMETERS; \
|
||||
}
|
||||
#define connect_check_codec_private(b) \
|
||||
if ( (!!this->m_ti.m_private_data != !!b->m_ti.m_private_data) \
|
||||
|| ( this->m_ti.m_private_size != b->m_ti.m_private_size) \
|
||||
|| ( this->m_ti.m_private_data && memcmp(this->m_ti.m_private_data, b->m_ti.m_private_data, this->m_ti.m_private_size))) { \
|
||||
error_message = (boost::format(Y("The codec's private data does not match (lengths: %1% and %2%).")) % this->m_ti.m_private_size % b->m_ti.m_private_size).str(); \
|
||||
return CAN_CONNECT_MAYBE_CODECPRIVATE; \
|
||||
}
|
||||
|
||||
typedef std::deque<packet_cptr>::iterator packet_cptr_di;
|
||||
|
||||
@ -508,8 +456,7 @@ protected:
|
||||
int m_htrack_max_add_block_ids;
|
||||
|
||||
std::string m_hcodec_id;
|
||||
unsigned char *m_hcodec_private;
|
||||
size_t m_hcodec_private_length;
|
||||
memory_cptr m_hcodec_private;
|
||||
|
||||
float m_haudio_sampling_freq, m_haudio_output_sampling_freq;
|
||||
int m_haudio_channels, m_haudio_bit_depth;
|
||||
@ -613,7 +560,7 @@ public:
|
||||
virtual void set_language(const std::string &language);
|
||||
|
||||
virtual void set_codec_id(const std::string &id);
|
||||
virtual void set_codec_private(const unsigned char *cp, int length);
|
||||
virtual void set_codec_private(memory_cptr const &buffer);
|
||||
|
||||
virtual void set_track_min_cache(int min_cache);
|
||||
virtual void set_track_max_cache(int max_cache);
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "common/aac.h"
|
||||
#include "common/hacks.h"
|
||||
#include "common/matroska.h"
|
||||
#include "merge/connection_checks.h"
|
||||
#include "output/p_aac.h"
|
||||
|
||||
using namespace libmatroska;
|
||||
@ -130,8 +131,8 @@ aac_packetizer_c::set_headers() {
|
||||
set_audio_sampling_freq((float)m_samples_per_sec);
|
||||
set_audio_channels(m_channels);
|
||||
|
||||
if (m_ti.m_private_data && (0 < m_ti.m_private_size))
|
||||
set_codec_private(m_ti.m_private_data, m_ti.m_private_size);
|
||||
if (m_ti.m_private_data && (0 < m_ti.m_private_data->get_size()))
|
||||
set_codec_private(m_ti.m_private_data);
|
||||
|
||||
else if (!hack_engaged(ENGAGE_OLD_AAC_CODECID)) {
|
||||
unsigned char buffer[5];
|
||||
@ -140,7 +141,7 @@ aac_packetizer_c::set_headers() {
|
||||
m_channels, m_samples_per_sec,
|
||||
AAC_PROFILE_SBR == m_profile ? m_samples_per_sec * 2 : m_samples_per_sec,
|
||||
AAC_PROFILE_SBR == m_profile);
|
||||
set_codec_private(buffer, length);
|
||||
set_codec_private(memory_c::clone(buffer, length));
|
||||
}
|
||||
|
||||
generic_packetizer_c::set_headers();
|
||||
|
@ -15,8 +15,8 @@
|
||||
|
||||
#include "common/ac3.h"
|
||||
#include "common/matroska.h"
|
||||
#include "merge/connection_checks.h"
|
||||
#include "merge/output_control.h"
|
||||
#include "merge/pr_generic.h"
|
||||
#include "output/p_ac3.h"
|
||||
|
||||
using namespace libmatroska;
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "common/alac.h"
|
||||
#include "common/hacks.h"
|
||||
#include "common/matroska.h"
|
||||
#include "merge/connection_checks.h"
|
||||
#include "output/p_alac.h"
|
||||
|
||||
using namespace libmatroska;
|
||||
@ -37,7 +38,7 @@ alac_packetizer_c::alac_packetizer_c(generic_reader_c *p_reader,
|
||||
set_audio_sampling_freq(static_cast<double>(m_sample_rate));
|
||||
set_audio_channels(m_channels);
|
||||
|
||||
set_codec_private(magic_cookie->get_buffer(), magic_cookie->get_size());
|
||||
set_codec_private(magic_cookie);
|
||||
}
|
||||
|
||||
alac_packetizer_c::~alac_packetizer_c() {
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "common/math.h"
|
||||
#include "common/matroska.h"
|
||||
#include "common/mpeg4_p10.h"
|
||||
#include "merge/connection_checks.h"
|
||||
#include "merge/output_control.h"
|
||||
#include "output/p_avc.h"
|
||||
|
||||
@ -114,8 +115,7 @@ mpeg4_p10_es_video_packetizer_c::handle_delayed_headers() {
|
||||
if (0 < m_parser.get_num_skipped_frames())
|
||||
mxwarn_tid(m_ti.m_fname, m_ti.m_id, boost::format(Y("This AVC/h.264 track does not start with a key frame. The first %1% frames have been skipped.\n")) % m_parser.get_num_skipped_frames());
|
||||
|
||||
memory_cptr new_avcc = m_parser.get_avcc();
|
||||
set_codec_private(new_avcc->get_buffer(), new_avcc->get_size());
|
||||
set_codec_private(m_parser.get_avcc());
|
||||
|
||||
if ( !m_reader->is_providing_timecodes()
|
||||
&& !m_timecode_factory
|
||||
|
@ -39,7 +39,7 @@ public:
|
||||
virtual void flush_frames();
|
||||
|
||||
virtual translatable_string_c get_format_name() const {
|
||||
return YT("AVC/h.264");
|
||||
return YT("AVC/h.264 (unframed)");
|
||||
};
|
||||
|
||||
virtual void connect(generic_packetizer_c *src, int64_t p_append_timecode_offset = -1);
|
||||
|
@ -16,8 +16,7 @@
|
||||
|
||||
#include "common/dts.h"
|
||||
#include "common/matroska.h"
|
||||
#include "merge/output_control.h"
|
||||
#include "merge/pr_generic.h"
|
||||
#include "merge/connection_checks.h"
|
||||
#include "output/p_dts.h"
|
||||
|
||||
using namespace libmatroska;
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "common/checksums.h"
|
||||
#include "common/flac.h"
|
||||
#include "common/matroska.h"
|
||||
#include "merge/pr_generic.h"
|
||||
#include "merge/connection_checks.h"
|
||||
#include "output/p_flac.h"
|
||||
|
||||
using namespace libmatroska;
|
||||
@ -58,7 +58,7 @@ flac_packetizer_c::~flac_packetizer_c() {
|
||||
void
|
||||
flac_packetizer_c::set_headers() {
|
||||
set_codec_id(MKV_A_FLAC);
|
||||
set_codec_private(m_header->get_buffer(), m_header->get_size());
|
||||
set_codec_private(m_header);
|
||||
set_audio_sampling_freq((float)m_stream_info.sample_rate);
|
||||
set_audio_channels(m_stream_info.channels);
|
||||
set_audio_bit_depth(m_stream_info.bits_per_sample);
|
||||
|
@ -19,26 +19,20 @@
|
||||
#include "common/endian.h"
|
||||
#include "common/kate.h"
|
||||
#include "common/matroska.h"
|
||||
#include "merge/pr_generic.h"
|
||||
#include "merge/connection_checks.h"
|
||||
#include "output/p_kate.h"
|
||||
|
||||
using namespace libmatroska;
|
||||
|
||||
kate_packetizer_c::kate_packetizer_c(generic_reader_c *p_reader,
|
||||
track_info_c &p_ti,
|
||||
const void *global_data,
|
||||
int global_size)
|
||||
: generic_packetizer_c(p_reader, p_ti)
|
||||
, m_global_data(new memory_c((unsigned char *)safememdup(global_data ? global_data : m_ti.m_private_data,
|
||||
global_data ? global_size : m_ti.m_private_size),
|
||||
global_data ? global_size : m_ti.m_private_size, true))
|
||||
, m_previous_timecode(0)
|
||||
kate_packetizer_c::kate_packetizer_c(generic_reader_c *reader,
|
||||
track_info_c &ti)
|
||||
: generic_packetizer_c{reader, ti}
|
||||
, m_previous_timecode{}
|
||||
{
|
||||
set_track_type(track_subtitle);
|
||||
|
||||
// the number of headers to expect is stored in the first header
|
||||
memory_cptr temp(new memory_c((unsigned char *)m_global_data->get_buffer(), m_global_data->get_size(), false));
|
||||
std::vector<memory_cptr> blocks = unlace_memory_xiph(temp);
|
||||
auto blocks = unlace_memory_xiph(m_ti.m_private_data);
|
||||
|
||||
kate_parse_identification_header(blocks[0]->get_buffer(), blocks[0]->get_size(), m_kate_id);
|
||||
if (blocks.size() != m_kate_id.nheaders)
|
||||
@ -56,9 +50,7 @@ kate_packetizer_c::~kate_packetizer_c() {
|
||||
void
|
||||
kate_packetizer_c::set_headers() {
|
||||
set_codec_id(MKV_S_KATE);
|
||||
|
||||
memory_cptr codec_private = lace_memory_xiph(m_headers);
|
||||
set_codec_private(codec_private->get_buffer(), codec_private->get_size());
|
||||
set_codec_private(lace_memory_xiph(m_headers));
|
||||
|
||||
generic_packetizer_c::set_headers();
|
||||
}
|
||||
|
@ -23,14 +23,13 @@
|
||||
class kate_packetizer_c: public generic_packetizer_c {
|
||||
private:
|
||||
std::vector<memory_cptr> m_headers;
|
||||
memory_cptr m_global_data;
|
||||
|
||||
kate_identification_header_t m_kate_id;
|
||||
|
||||
int64_t m_previous_timecode;
|
||||
|
||||
public:
|
||||
kate_packetizer_c(generic_reader_c *p_reader, track_info_c &p_ti, const void *global_data, int global_size);
|
||||
kate_packetizer_c(generic_reader_c *reader, track_info_c &ti);
|
||||
virtual ~kate_packetizer_c();
|
||||
|
||||
virtual int process(packet_cptr packet);
|
||||
|
@ -15,6 +15,7 @@
|
||||
|
||||
#include "common/matroska.h"
|
||||
#include "common/mp3.h"
|
||||
#include "merge/connection_checks.h"
|
||||
#include "merge/output_control.h"
|
||||
#include "output/p_mp3.h"
|
||||
|
||||
|
@ -161,7 +161,7 @@ mpeg1_2_video_packetizer_c::remove_stuffing_bytes_and_handle_sequence_headers(pa
|
||||
return;
|
||||
|
||||
if (!m_hcodec_private) {
|
||||
set_codec_private(new_seq_hdr->get_buffer(), new_seq_hdr->get_size());
|
||||
set_codec_private(new_seq_hdr);
|
||||
rerender_track_headers();
|
||||
}
|
||||
|
||||
@ -282,7 +282,7 @@ void
|
||||
mpeg1_2_video_packetizer_c::create_private_data() {
|
||||
MPEGChunk *raw_seq_hdr = m_parser.GetRealSequenceHeader();
|
||||
if (raw_seq_hdr) {
|
||||
set_codec_private(raw_seq_hdr->GetPointer(), raw_seq_hdr->GetSize());
|
||||
set_codec_private(memory_c::clone(raw_seq_hdr->GetPointer(), raw_seq_hdr->GetSize()));
|
||||
rerender_track_headers();
|
||||
}
|
||||
}
|
||||
|
@ -37,21 +37,19 @@ mpeg4_p10_video_packetizer_c(generic_reader_c *p_reader,
|
||||
|
||||
setup_nalu_size_len_change();
|
||||
|
||||
if (m_ti.m_private_data && (0 < m_ti.m_private_size))
|
||||
set_codec_private(m_ti.m_private_data, m_ti.m_private_size);
|
||||
set_codec_private(m_ti.m_private_data);
|
||||
}
|
||||
|
||||
void
|
||||
mpeg4_p10_video_packetizer_c::set_headers() {
|
||||
if (m_ti.m_private_data && m_ti.m_private_size) {
|
||||
if (m_ti.m_private_data && m_ti.m_private_data->get_size()) {
|
||||
extract_aspect_ratio();
|
||||
|
||||
if (m_ti.m_fix_bitstream_frame_rate) {
|
||||
int64_t l_track_default_duration = 0.0 < m_fps ? static_cast<int64_t>(1000000000.0 / m_fps) : -1;
|
||||
int64_t duration = m_timecode_factory ? m_timecode_factory->get_default_duration(l_track_default_duration) : l_track_default_duration;
|
||||
|
||||
mpeg4::p10::fix_sps_fps(m_ti.m_private_data, m_ti.m_private_size, duration);
|
||||
set_codec_private(m_ti.m_private_data, m_ti.m_private_size);
|
||||
set_codec_private(mpeg4::p10::fix_sps_fps(m_ti.m_private_data, duration));
|
||||
}
|
||||
}
|
||||
|
||||
@ -60,21 +58,24 @@ mpeg4_p10_video_packetizer_c::set_headers() {
|
||||
|
||||
void
|
||||
mpeg4_p10_video_packetizer_c::extract_aspect_ratio() {
|
||||
uint32_t num, den;
|
||||
uint32_t num = 0, den = 0;
|
||||
|
||||
if (mpeg4::p10::extract_par(m_ti.m_private_data, m_ti.m_private_size, num, den) && (0 != num) && (0 != den)) {
|
||||
if (!display_dimensions_or_aspect_ratio_set()) {
|
||||
double par = (double)num / (double)den;
|
||||
if (!m_ti.m_private_data)
|
||||
return;
|
||||
|
||||
set_video_display_dimensions(1 <= par ? irnd(m_width * par) : m_width,
|
||||
1 <= par ? m_height : irnd(m_height / par),
|
||||
PARAMETER_SOURCE_BITSTREAM);
|
||||
mpeg4::p10::extract_par(m_ti.m_private_data, num, den);
|
||||
if (!num || !den || display_dimensions_or_aspect_ratio_set())
|
||||
return;
|
||||
|
||||
mxinfo_tid(m_ti.m_fname, m_ti.m_id,
|
||||
boost::format(Y("Extracted the aspect ratio information from the MPEG-4 layer 10 (AVC) video data and set the display dimensions to %1%/%2%.\n"))
|
||||
% m_ti.m_display_width % m_ti.m_display_height);
|
||||
}
|
||||
}
|
||||
auto par = static_cast<double>(num) / static_cast<double>(den);
|
||||
|
||||
set_video_display_dimensions(1 <= par ? irnd(m_width * par) : m_width,
|
||||
1 <= par ? m_height : irnd(m_height / par),
|
||||
PARAMETER_SOURCE_BITSTREAM);
|
||||
|
||||
mxinfo_tid(m_ti.m_fname, m_ti.m_id,
|
||||
boost::format(Y("Extracted the aspect ratio information from the MPEG-4 layer 10 (AVC) video data and set the display dimensions to %1%/%2%.\n"))
|
||||
% m_ti.m_display_width % m_ti.m_display_height);
|
||||
}
|
||||
|
||||
int
|
||||
@ -105,8 +106,8 @@ mpeg4_p10_video_packetizer_c::can_connect_to(generic_packetizer_c *src,
|
||||
if (CAN_CONNECT_YES != result)
|
||||
return result;
|
||||
|
||||
if (m_ti.m_private_data && memcmp(m_ti.m_private_data, vsrc->m_ti.m_private_data, m_ti.m_private_size)) {
|
||||
error_message = (boost::format(Y("The codec's private data does not match. Both have the same length (%1%) but different content.")) % m_ti.m_private_size).str();
|
||||
if (m_ti.m_private_data && vsrc->m_ti.m_private_data && memcmp(m_ti.m_private_data->get_buffer(), vsrc->m_ti.m_private_data->get_buffer(), m_ti.m_private_data->get_size())) {
|
||||
error_message = (boost::format(Y("The codec's private data does not match. Both have the same length (%1%) but different content.")) % m_ti.m_private_data->get_size()).str();
|
||||
return CAN_CONNECT_MAYBE_CODECPRIVATE;
|
||||
}
|
||||
|
||||
@ -115,20 +116,21 @@ mpeg4_p10_video_packetizer_c::can_connect_to(generic_packetizer_c *src,
|
||||
|
||||
void
|
||||
mpeg4_p10_video_packetizer_c::setup_nalu_size_len_change() {
|
||||
if (!m_ti.m_private_data || (5 > m_ti.m_private_size))
|
||||
if (!m_ti.m_private_data || (5 > m_ti.m_private_data->get_size()))
|
||||
return;
|
||||
|
||||
m_nalu_size_len_src = (m_ti.m_private_data[4] & 0x03) + 1;
|
||||
auto private_data = m_ti.m_private_data->get_buffer();
|
||||
m_nalu_size_len_src = (private_data[4] & 0x03) + 1;
|
||||
m_nalu_size_len_dst = m_nalu_size_len_src;
|
||||
|
||||
if (!m_ti.m_nalu_size_length || (m_ti.m_nalu_size_length == m_nalu_size_len_src))
|
||||
return;
|
||||
|
||||
m_nalu_size_len_dst = m_ti.m_nalu_size_length;
|
||||
m_ti.m_private_data[4] = (m_ti.m_private_data[4] & 0xfc) | (m_nalu_size_len_dst - 1);
|
||||
m_max_nalu_size = 1ll << (8 * m_nalu_size_len_dst);
|
||||
m_nalu_size_len_dst = m_ti.m_nalu_size_length;
|
||||
private_data[4] = (private_data[4] & 0xfc) | (m_nalu_size_len_dst - 1);
|
||||
m_max_nalu_size = 1ll << (8 * m_nalu_size_len_dst);
|
||||
|
||||
set_codec_private(m_ti.m_private_data, m_ti.m_private_size);
|
||||
set_codec_private(m_ti.m_private_data);
|
||||
|
||||
mxverb(2, boost::format("mpeg4_p10: Adjusting NALU size length from %1% to %2%\n") % m_nalu_size_len_src % m_nalu_size_len_dst);
|
||||
}
|
||||
|
@ -46,11 +46,8 @@ mpeg4_p2_video_packetizer_c(generic_reader_c *p_reader,
|
||||
|
||||
} else {
|
||||
set_codec_id(MKV_V_MPEG4_ASP);
|
||||
if (!m_input_is_native) {
|
||||
safefree(m_ti.m_private_data);
|
||||
m_ti.m_private_data = nullptr;
|
||||
m_ti.m_private_size = 0;
|
||||
}
|
||||
if (!m_input_is_native)
|
||||
m_ti.m_private_data.reset();
|
||||
|
||||
// If no external timecode file has been specified then mkvmerge
|
||||
// might have created a factory due to the --default-duration
|
||||
@ -176,16 +173,12 @@ mpeg4_p2_video_packetizer_c::extract_config_data(packet_cptr &packet) {
|
||||
if (m_ti.m_private_data)
|
||||
return;
|
||||
|
||||
memory_c *config_data = mpeg4::p2::parse_config_data(packet->data->get_buffer(), packet->data->get_size(), m_config_data);
|
||||
if (!config_data)
|
||||
m_ti.m_private_data = memory_cptr{mpeg4::p2::parse_config_data(packet->data->get_buffer(), packet->data->get_size(), m_config_data)};
|
||||
if (!m_ti.m_private_data)
|
||||
mxerror_tid(m_ti.m_fname, m_ti.m_id, Y("Could not find the codec configuration data in the first MPEG-4 part 2 video frame. This track cannot be stored in native mode.\n"));
|
||||
|
||||
m_ti.m_private_data = (unsigned char *)safememdup(config_data->get_buffer(), config_data->get_size());
|
||||
m_ti.m_private_size = config_data->get_size();
|
||||
delete config_data;
|
||||
|
||||
fix_codec_string();
|
||||
set_codec_private(m_ti.m_private_data, m_ti.m_private_size);
|
||||
set_codec_private(m_ti.m_private_data);
|
||||
rerender_track_headers();
|
||||
}
|
||||
|
||||
@ -193,13 +186,14 @@ void
|
||||
mpeg4_p2_video_packetizer_c::fix_codec_string() {
|
||||
static const unsigned char start_code[4] = {0x00, 0x00, 0x01, 0xb2};
|
||||
|
||||
if (!m_ti.m_private_data || (0 == m_ti.m_private_size))
|
||||
if (!m_ti.m_private_data || (0 == m_ti.m_private_data->get_size()))
|
||||
return;
|
||||
|
||||
int size = m_ti.m_private_size;
|
||||
auto private_data = m_ti.m_private_data->get_buffer();
|
||||
int size = m_ti.m_private_data->get_size();
|
||||
int i;
|
||||
for (i = 0; 9 < size;) {
|
||||
if (memcmp(&m_ti.m_private_data[i], start_code, 4) != 0) {
|
||||
if (memcmp(&private_data[i], start_code, 4) != 0) {
|
||||
++i;
|
||||
--size;
|
||||
continue;
|
||||
@ -207,12 +201,12 @@ mpeg4_p2_video_packetizer_c::fix_codec_string() {
|
||||
|
||||
i += 8;
|
||||
size -= 8;
|
||||
if (strncasecmp((const char *)&m_ti.m_private_data[i - 4], "divx", 4) != 0)
|
||||
if (strncasecmp((const char *)&private_data[i - 4], "divx", 4) != 0)
|
||||
continue;
|
||||
|
||||
unsigned char *end_pos = (unsigned char *)memchr(&m_ti.m_private_data[i], 0, size);
|
||||
unsigned char *end_pos = (unsigned char *)memchr(&private_data[i], 0, size);
|
||||
if (!end_pos)
|
||||
end_pos = &m_ti.m_private_data[i + size];
|
||||
end_pos = &private_data[i + size];
|
||||
|
||||
--end_pos;
|
||||
if ('p' == *end_pos)
|
||||
@ -361,11 +355,11 @@ mpeg4_p2_video_packetizer_c::extract_size(const unsigned char *buffer,
|
||||
set_video_pixel_width(xtr_width);
|
||||
set_video_pixel_height(xtr_height);
|
||||
|
||||
if (!m_output_is_native && (sizeof(alBITMAPINFOHEADER) <= m_ti.m_private_size)) {
|
||||
alBITMAPINFOHEADER *bih = (alBITMAPINFOHEADER *)m_ti.m_private_data;
|
||||
if (!m_output_is_native && m_ti.m_private_data && (sizeof(alBITMAPINFOHEADER) <= m_ti.m_private_data->get_size())) {
|
||||
auto bih = reinterpret_cast<alBITMAPINFOHEADER *>(m_ti.m_private_data->get_buffer());
|
||||
put_uint32_le(&bih->bi_width, xtr_width);
|
||||
put_uint32_le(&bih->bi_height, xtr_height);
|
||||
set_codec_private(m_ti.m_private_data, m_ti.m_private_size);
|
||||
set_codec_private(m_ti.m_private_data);
|
||||
}
|
||||
|
||||
m_hvideo_display_width = -1;
|
||||
|
@ -15,25 +15,24 @@
|
||||
|
||||
#include "common/matroska.h"
|
||||
#include "common/opus.h"
|
||||
|
||||
#include "merge/connection_checks.h"
|
||||
#include "output/p_opus.h"
|
||||
|
||||
using namespace libmatroska;
|
||||
|
||||
opus_packetizer_c::opus_packetizer_c(generic_reader_c *p_reader,
|
||||
track_info_c &p_ti,
|
||||
memory_cptr const &id_header)
|
||||
: generic_packetizer_c(p_reader, p_ti)
|
||||
opus_packetizer_c::opus_packetizer_c(generic_reader_c *reader,
|
||||
track_info_c &ti)
|
||||
: generic_packetizer_c(reader, ti)
|
||||
, m_debug{debugging_requested("opus|opus_packetizer")}
|
||||
, m_next_calculated_timecode{timecode_c::ns(0)}
|
||||
, m_id_header(mtx::opus::id_header_t::decode(id_header))
|
||||
, m_id_header(mtx::opus::id_header_t::decode(ti.m_private_data))
|
||||
{
|
||||
mxdebug_if(m_debug, boost::format("ID header: %1%\n") % m_id_header);
|
||||
|
||||
show_experimental_status_version(MKV_A_OPUS);
|
||||
|
||||
set_track_type(track_audio);
|
||||
set_codec_private(id_header->get_buffer(), id_header->get_size());
|
||||
set_codec_private(m_ti.m_private_data);
|
||||
}
|
||||
|
||||
opus_packetizer_c::~opus_packetizer_c() {
|
||||
|
@ -28,7 +28,7 @@ private:
|
||||
mtx::opus::id_header_t m_id_header;
|
||||
|
||||
public:
|
||||
opus_packetizer_c(generic_reader_c *p_reader, track_info_c &p_ti, memory_cptr const &id_header);
|
||||
opus_packetizer_c(generic_reader_c *reader, track_info_c &ti);
|
||||
virtual ~opus_packetizer_c();
|
||||
|
||||
virtual int process(packet_cptr packet);
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "common/common_pch.h"
|
||||
|
||||
#include "common/matroska.h"
|
||||
#include "merge/pr_generic.h"
|
||||
#include "merge/connection_checks.h"
|
||||
#include "output/p_passthrough.h"
|
||||
|
||||
using namespace libmatroska;
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "common/common_pch.h"
|
||||
|
||||
#include "common/matroska.h"
|
||||
#include "merge/pr_generic.h"
|
||||
#include "merge/connection_checks.h"
|
||||
#include "output/p_pcm.h"
|
||||
|
||||
using namespace libmatroska;
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "common/common_pch.h"
|
||||
|
||||
#include "common/matroska.h"
|
||||
#include "merge/pr_generic.h"
|
||||
#include "merge/connection_checks.h"
|
||||
#include "output/p_realaudio.h"
|
||||
|
||||
using namespace libmatroska;
|
||||
@ -24,14 +24,12 @@ ra_packetizer_c::ra_packetizer_c(generic_reader_c *p_reader,
|
||||
int samples_per_sec,
|
||||
int channels,
|
||||
int bits_per_sample,
|
||||
uint32_t fourcc,
|
||||
const memory_cptr &private_data)
|
||||
uint32_t fourcc)
|
||||
: generic_packetizer_c(p_reader, p_ti)
|
||||
, m_samples_per_sec(samples_per_sec)
|
||||
, m_channels(channels)
|
||||
, m_bits_per_sample(bits_per_sample)
|
||||
, m_fourcc(fourcc)
|
||||
, m_private_data(private_data ? private_data->clone() : private_data)
|
||||
{
|
||||
set_track_type(track_audio, TFA_SHORT_QUEUEING);
|
||||
}
|
||||
@ -47,8 +45,7 @@ ra_packetizer_c::set_headers() {
|
||||
set_audio_sampling_freq((float)m_samples_per_sec);
|
||||
set_audio_channels(m_channels);
|
||||
set_audio_bit_depth(m_bits_per_sample);
|
||||
if (m_private_data)
|
||||
set_codec_private(m_private_data->get_buffer(), m_private_data->get_size());
|
||||
set_codec_private(m_ti.m_private_data);
|
||||
|
||||
generic_packetizer_c::set_headers();
|
||||
m_track_entry->EnableLacing(false);
|
||||
|
@ -22,10 +22,9 @@ class ra_packetizer_c: public generic_packetizer_c {
|
||||
private:
|
||||
int m_samples_per_sec, m_channels, m_bits_per_sample;
|
||||
uint32_t m_fourcc;
|
||||
memory_cptr m_private_data;
|
||||
|
||||
public:
|
||||
ra_packetizer_c(generic_reader_c *p_reader, track_info_c &p_ti, int samples_per_sec, int channels, int bits_per_sample, uint32_t fourcc, const memory_cptr &private_data);
|
||||
ra_packetizer_c(generic_reader_c *p_reader, track_info_c &p_ti, int samples_per_sec, int channels, int bits_per_sample, uint32_t fourcc);
|
||||
virtual ~ra_packetizer_c();
|
||||
|
||||
virtual int process(packet_cptr packet);
|
||||
|
@ -14,8 +14,8 @@
|
||||
#include "common/common_pch.h"
|
||||
|
||||
#include "common/matroska.h"
|
||||
#include "merge/connection_checks.h"
|
||||
#include "merge/packet_extensions.h"
|
||||
#include "merge/pr_generic.h"
|
||||
#include "output/p_textsubs.h"
|
||||
|
||||
using namespace libmatroska;
|
||||
@ -27,13 +27,10 @@ boost::regex textsubs_packetizer_c::s_re_translate_nl("\n", boost::regex::perl);
|
||||
textsubs_packetizer_c::textsubs_packetizer_c(generic_reader_c *p_reader,
|
||||
track_info_c &p_ti,
|
||||
const char *codec_id,
|
||||
const void *global_data,
|
||||
int global_size,
|
||||
bool recode,
|
||||
bool is_utf8)
|
||||
: generic_packetizer_c(p_reader, p_ti)
|
||||
, m_packetno(0)
|
||||
, m_global_data(new memory_c((unsigned char *)safememdup(global_data, global_size), global_size, true))
|
||||
, m_codec_id(codec_id)
|
||||
, m_recode(recode)
|
||||
{
|
||||
@ -51,9 +48,7 @@ textsubs_packetizer_c::~textsubs_packetizer_c() {
|
||||
void
|
||||
textsubs_packetizer_c::set_headers() {
|
||||
set_codec_id(m_codec_id);
|
||||
|
||||
if (m_global_data->is_allocated())
|
||||
set_codec_private((unsigned char *)m_global_data->get_buffer(), m_global_data->get_size());
|
||||
set_codec_private(m_ti.m_private_data);
|
||||
|
||||
generic_packetizer_c::set_headers();
|
||||
|
||||
|
@ -22,12 +22,11 @@ class textsubs_packetizer_c: public generic_packetizer_c {
|
||||
private:
|
||||
int m_packetno;
|
||||
charset_converter_cptr m_cc_utf8;
|
||||
memory_cptr m_global_data;
|
||||
std::string m_codec_id;
|
||||
bool m_recode;
|
||||
|
||||
public:
|
||||
textsubs_packetizer_c(generic_reader_c *p_reader, track_info_c &p_ti, const char *codec_id, const void *global_data, int global_size, bool recode, bool is_utf8);
|
||||
textsubs_packetizer_c(generic_reader_c *p_reader, track_info_c &p_ti, const char *codec_id, bool recode, bool is_utf8);
|
||||
virtual ~textsubs_packetizer_c();
|
||||
|
||||
virtual int process(packet_cptr packet);
|
||||
|
@ -51,11 +51,10 @@ theora_video_packetizer_c::process(packet_cptr packet) {
|
||||
|
||||
void
|
||||
theora_video_packetizer_c::extract_aspect_ratio() {
|
||||
if (display_dimensions_or_aspect_ratio_set() || !m_ti.m_private_data || (0 == m_ti.m_private_size))
|
||||
if (display_dimensions_or_aspect_ratio_set() || !m_ti.m_private_data || (0 == m_ti.m_private_data->get_size()))
|
||||
return;
|
||||
|
||||
memory_cptr private_data = memory_cptr(new memory_c(m_ti.m_private_data, m_ti.m_private_size, false));
|
||||
std::vector<memory_cptr> packets = unlace_memory_xiph(private_data);
|
||||
auto packets = unlace_memory_xiph(m_ti.m_private_data);
|
||||
|
||||
for (auto &packet : packets) {
|
||||
if ((0 == packet->get_size()) || (THEORA_HEADERTYPE_IDENTIFICATION != packet->get_buffer()[0]))
|
||||
|
@ -16,8 +16,8 @@
|
||||
#include "common/hacks.h"
|
||||
#include "common/matroska.h"
|
||||
#include "common/truehd.h"
|
||||
#include "merge/connection_checks.h"
|
||||
#include "merge/output_control.h"
|
||||
#include "merge/pr_generic.h"
|
||||
#include "output/p_truehd.h"
|
||||
|
||||
using namespace libmatroska;
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "common/math.h"
|
||||
#include "common/matroska.h"
|
||||
#include "common/tta.h"
|
||||
#include "merge/connection_checks.h"
|
||||
#include "output/p_tta.h"
|
||||
|
||||
using namespace libmatroska;
|
||||
|
@ -88,7 +88,7 @@ vc1_video_packetizer_c::set_headers() {
|
||||
} else
|
||||
set_track_default_duration(1000000000ll * 1001 / 30000);
|
||||
|
||||
set_codec_private(buf->get_buffer(), buf->get_size());
|
||||
set_codec_private(buf);
|
||||
|
||||
generic_packetizer_c::set_headers();
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "common/math.h"
|
||||
#include "common/matroska.h"
|
||||
#include "common/mpeg4_p2.h"
|
||||
#include "merge/output_control.h"
|
||||
#include "merge/connection_checks.h"
|
||||
#include "output/p_video.h"
|
||||
|
||||
#include <avilib.h>
|
||||
@ -49,7 +49,7 @@ video_packetizer_c::video_packetizer_c(generic_reader_c *p_reader,
|
||||
else
|
||||
set_codec_id(MKV_V_MSCOMP);
|
||||
|
||||
set_codec_private(m_ti.m_private_data, m_ti.m_private_size);
|
||||
set_codec_private(m_ti.m_private_data);
|
||||
check_fourcc();
|
||||
}
|
||||
|
||||
@ -57,16 +57,16 @@ void
|
||||
video_packetizer_c::check_fourcc() {
|
||||
if ( (m_hcodec_id != MKV_V_MSCOMP)
|
||||
|| !m_ti.m_private_data
|
||||
|| (sizeof(alBITMAPINFOHEADER) > m_ti.m_private_size))
|
||||
|| (sizeof(alBITMAPINFOHEADER) > m_ti.m_private_data->get_size()))
|
||||
return;
|
||||
|
||||
if (!m_ti.m_fourcc.empty()) {
|
||||
memcpy(&((alBITMAPINFOHEADER *)m_ti.m_private_data)->bi_compression, m_ti.m_fourcc.c_str(), 4);
|
||||
set_codec_private(m_ti.m_private_data, m_ti.m_private_size);
|
||||
memcpy(&reinterpret_cast<alBITMAPINFOHEADER *>(m_ti.m_private_data->get_buffer())->bi_compression, m_ti.m_fourcc.c_str(), 4);
|
||||
set_codec_private(m_ti.m_private_data);
|
||||
}
|
||||
|
||||
char fourcc[5];
|
||||
memcpy(fourcc, &((alBITMAPINFOHEADER *)m_ti.m_private_data)->bi_compression, 4);
|
||||
memcpy(fourcc, &reinterpret_cast<alBITMAPINFOHEADER *>(m_ti.m_private_data->get_buffer())->bi_compression, 4);
|
||||
fourcc[4] = 0;
|
||||
|
||||
if (mpeg4::p2::is_v3_fourcc(fourcc))
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "common/endian.h"
|
||||
#include "common/matroska.h"
|
||||
#include "common/mm_io.h"
|
||||
#include "merge/connection_checks.h"
|
||||
#include "output/p_vobbtn.h"
|
||||
|
||||
using namespace libmatroska;
|
||||
|
@ -23,12 +23,9 @@
|
||||
|
||||
using namespace libmatroska;
|
||||
|
||||
vobsub_packetizer_c::vobsub_packetizer_c(generic_reader_c *_reader,
|
||||
const void *_idx_data,
|
||||
int _idx_data_size,
|
||||
track_info_c &_ti)
|
||||
: generic_packetizer_c(_reader, _ti)
|
||||
, idx_data(new memory_c((unsigned char *)safememdup(_idx_data, _idx_data_size), _idx_data_size, true))
|
||||
vobsub_packetizer_c::vobsub_packetizer_c(generic_reader_c *reader,
|
||||
track_info_c &ti)
|
||||
: generic_packetizer_c(reader, ti)
|
||||
{
|
||||
set_track_type(track_subtitle);
|
||||
set_default_compression_method(COMPRESSION_ZLIB);
|
||||
@ -40,7 +37,7 @@ vobsub_packetizer_c::~vobsub_packetizer_c() {
|
||||
void
|
||||
vobsub_packetizer_c::set_headers() {
|
||||
set_codec_id(MKV_S_VOBSUB);
|
||||
set_codec_private(idx_data->get_buffer(), idx_data->get_size());
|
||||
set_codec_private(m_ti.m_private_data);
|
||||
|
||||
generic_packetizer_c::set_headers();
|
||||
|
||||
|
@ -20,11 +20,8 @@
|
||||
#include "merge/pr_generic.h"
|
||||
|
||||
class vobsub_packetizer_c: public generic_packetizer_c {
|
||||
private:
|
||||
memory_cptr idx_data;
|
||||
|
||||
public:
|
||||
vobsub_packetizer_c(generic_reader_c *_reader, const void *_idx_data, int _idx_data_size, track_info_c &_ti);
|
||||
vobsub_packetizer_c(generic_reader_c *reader, track_info_c &ti);
|
||||
virtual ~vobsub_packetizer_c();
|
||||
|
||||
virtual int process(packet_cptr packet);
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <vorbis/codec.h>
|
||||
|
||||
#include "common/matroska.h"
|
||||
#include "merge/connection_checks.h"
|
||||
#include "merge/output_control.h"
|
||||
#include "output/p_vorbis.h"
|
||||
|
||||
@ -76,8 +77,7 @@ vorbis_packetizer_c::set_headers() {
|
||||
|
||||
set_codec_id(MKV_A_VORBIS);
|
||||
|
||||
memory_cptr codec_private = lace_memory_xiph(m_headers);
|
||||
set_codec_private(codec_private->get_buffer(), codec_private->get_size());
|
||||
set_codec_private(lace_memory_xiph(m_headers));
|
||||
|
||||
set_audio_sampling_freq((float)m_vi.rate);
|
||||
set_audio_channels(m_vi.channels);
|
||||
|
@ -15,6 +15,7 @@
|
||||
|
||||
#include "common/ivf.h"
|
||||
#include "common/matroska.h"
|
||||
#include "merge/connection_checks.h"
|
||||
#include "output/p_vp8.h"
|
||||
|
||||
using namespace libmatroska;
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "common/endian.h"
|
||||
#include "common/math.h"
|
||||
#include "common/matroska.h"
|
||||
#include "merge/connection_checks.h"
|
||||
#include "output/p_wavpack.h"
|
||||
|
||||
using namespace libmatroska;
|
||||
@ -37,7 +38,7 @@ wavpack_packetizer_c::wavpack_packetizer_c(generic_reader_c *p_reader,
|
||||
void
|
||||
wavpack_packetizer_c::set_headers() {
|
||||
set_codec_id(MKV_A_WAVPACK4);
|
||||
set_codec_private(m_ti.m_private_data, m_ti.m_private_size);
|
||||
set_codec_private(m_ti.m_private_data);
|
||||
set_audio_sampling_freq((float)m_sample_rate);
|
||||
set_audio_channels(m_channels);
|
||||
set_audio_bit_depth(m_bits_per_sample);
|
||||
|
Loading…
Reference in New Issue
Block a user