本文整理汇总了PHP中getid3_riff::array_merge_noclobber方法的典型用法代码示例。如果您正苦于以下问题:PHP getid3_riff::array_merge_noclobber方法的具体用法?PHP getid3_riff::array_merge_noclobber怎么用?PHP getid3_riff::array_merge_noclobber使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类getid3_riff
的用法示例。
在下文中一共展示了getid3_riff::array_merge_noclobber方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Analyze
//.........这里部分代码省略.........
// Error Correction Type GUID 128 // getid3_asf::Audio_Spread for audio-only streams, getid3_asf::No_Error_Correction for other stream types
// Time Offset QWORD 64 // 100-nanosecond units. typically zero. added to all timestamps of samples in the stream
// Type-Specific Data Length DWORD 32 // number of bytes for Type-Specific Data field
// Error Correction Data Length DWORD 32 // number of bytes for Error Correction Data field
// Flags WORD 16 //
// * Stream Number bits 7 (0x007F) // number of this stream. 1 <= valid <= 127
// * Reserved bits 8 (0x7F80) // reserved - set to zero
// * Encrypted Content Flag bits 1 (0x8000) // stream contents encrypted if set
// Reserved DWORD 32 // reserved - set to zero
// Type-Specific Data BYTESTREAM variable // type-specific format data, depending on value of Stream Type
// Error Correction Data BYTESTREAM variable // error-correction-specific format data, depending on value of Error Correct Type
// There is one getid3_asf::Stream_Properties_Object for each stream (audio, video) but the
// stream number isn't known until halfway through decoding the structure, hence it
// it is decoded to a temporary variable and then stuck in the appropriate index later
$stream_properties_object_data['objectid_guid'] = $next_object_guidtext;
$stream_properties_object_data['objectsize'] = $next_object_size;
getid3_lib::ReadSequence('LittleEndian2Int', $stream_properties_object_data, $asf_header_data, $offset, array('stream_type' => -16, 'error_correct_type' => -16, 'time_offset' => 8, 'type_data_length' => 4, 'error_data_length' => 4, 'flags_raw' => 2));
$stream_properties_stream_number = $stream_properties_object_data['flags_raw'] & 0x7f;
$stream_properties_object_data['flags']['encrypted'] = (bool) ($stream_properties_object_data['flags_raw'] & 0x8000);
$stream_properties_object_data['stream_type_guid'] = getid3_asf::BytestringToGUID($stream_properties_object_data['stream_type']);
$stream_properties_object_data['error_correct_guid'] = getid3_asf::BytestringToGUID($stream_properties_object_data['error_correct_type']);
$offset += 54;
// 50 bytes + 4 bytes reserved - DWORD
$stream_properties_object_data['type_specific_data'] = substr($asf_header_data, $offset, $stream_properties_object_data['type_data_length']);
$offset += $stream_properties_object_data['type_data_length'];
$stream_properties_object_data['error_correct_data'] = substr($asf_header_data, $offset, $stream_properties_object_data['error_data_length']);
$offset += $stream_properties_object_data['error_data_length'];
switch ($stream_properties_object_data['stream_type_guid']) {
case getid3_asf::Audio_Media:
$info_audio['dataformat'] = @$info_audio['dataformat'] ? $info_audio['dataformat'] : 'asf';
$info_audio['bitrate_mode'] = @$info_audio['bitrate_mode'] ? $info_audio['bitrate_mode'] : 'cbr';
$audiodata = getid3_riff::RIFFparseWAVEFORMATex(substr($stream_properties_object_data['type_specific_data'], 0, 16));
unset($audiodata['raw']);
$info_audio = getid3_riff::array_merge_noclobber($audiodata, $info_audio);
break;
case getid3_asf::Video_Media:
$info_video['dataformat'] = @$info_video['dataformat'] ? $info_video['dataformat'] : 'asf';
$info_video['bitrate_mode'] = @$info_video['bitrate_mode'] ? $info_video['bitrate_mode'] : 'cbr';
break;
/* does nothing but eat memory
case getid3_asf::Command_Media:
default:
// do nothing
break;
*/
}
$info_asf['stream_properties_object'][$stream_properties_stream_number] = $stream_properties_object_data;
unset($stream_properties_object_data);
// clear for next stream, if any
break;
case getid3_asf::Header_Extension_Object:
// Header Extension Object: (mandatory, one only)
// Field Name Field Type Size (bits)
// Object ID GUID 128 // GUID for Header Extension object - getid3_asf::Header_Extension_Object
// Object Size QWORD 64 // size of Header Extension object, including 46 bytes of Header Extension Object header
// Reserved Field 1 GUID 128 // hardcoded: getid3_asf::Reserved_1
// Reserved Field 2 WORD 16 // hardcoded: 0x00000006
// Header Extension Data Size DWORD 32 // in bytes. valid: 0, or > 24. equals object size minus 46
// Header Extension Data BYTESTREAM variable // array of zero or more extended header objects
$info_asf['header_extension_object'] = array();
$info_asf_header_extension_object =& $info_asf['header_extension_object'];
$info_asf_header_extension_object['objectid_guid'] = $next_object_guidtext;
$info_asf_header_extension_object['objectsize'] = $next_object_size;
$info_asf_header_extension_object['reserved_1_guid'] = getid3_asf::BytestringToGUID(substr($asf_header_data, $offset, 16));
$offset += 16;
if ($info_asf_header_extension_object['reserved_1_guid'] != getid3_asf::Reserved_1) {
示例2: array_merge_noclobber
public static function array_merge_noclobber($array1, $array2)
{
if (!is_array($array1) || !is_array($array2)) {
return false;
}
$new_array = $array1;
foreach ($array2 as $key => $val) {
if (is_array($val) && isset($new_array[$key]) && is_array($new_array[$key])) {
$new_array[$key] = getid3_riff::array_merge_noclobber($new_array[$key], $val);
} elseif (!isset($new_array[$key])) {
$new_array[$key] = $val;
}
}
return $new_array;
}