unsigned

ffmpeg编码aac文件通过extradata添加adts头

旧街凉风 提交于 2019-12-21 04:59:20
转载一篇文章: 1:ffmpeg的aac通过pcm编码得到的数据是latm的,如果需要存成adts能播的文件需要加头,ffmpeg并没有给相关的filter,通过extradata自己做解析加头; 2:aac_adtstoasc这个filter是把adts转成latm; 3:h264_mp4toannexb是将4个字节长度前缀的h264转成00 00 00 01 前缀的能播放的h264; 下面为转载; 转载链接: https://blog.csdn.net/lichen18848950451/article/details/78266054 根据雷神的代码,可以获取mp3等音频文件。网址是:http://blog.csdn.net/leixiaohua1020/article/details/39767055 同时,还可以把数据回调出去,进行其他的处理,是没有任何问题的。可是,现在的视频文件大都是H264+AAC。可是,根据雷神的代码是获取的数据,在播放器上播放失败。这是由于获取的aac数据是缺少adts文件头,添加上去就可以了。说着容易,可是做就难了。 网上的文章大都是介绍adts的,进行处理的代码很少。不过还是找到了,网址是http://blog.csdn.net/leixiaohua1020/article/details/39767055 不过

Writing unsigned int of 4 bytes over network

半城伤御伤魂 提交于 2019-12-21 02:59:35
问题 I have problem writing an unsigned 4 bytes int in java. Either writing a long value in java has different result on 64 bit MacOS and 32 bit Linux (Ubuntu) OR Writing to network a 4 byte unsigned int has a problem. The following call works perfectly on my local OSX writeUInt32(999999,outputstream) Reading it back gives me 999999 However when the application is deployed to a network writing a long value results in some other random number (I assume the endian has been switched?) and reading it

C++ 修饰符类型

允我心安 提交于 2019-12-20 23:38:43
C++ 允许在 char、int 和 double 数据类型前放置修饰符。修饰符用于改变基本类型的含义,所以它更能满足各种情境的需求。 下面列出了数据类型修饰符: signed unsigned long short 修饰符 signed、unsigned、long 和 short 可应用于整型, signed 和 unsigned 可应用于字符型, long 可应用于双精度型。 修饰符 signed 和 unsigned 也可以作为 long 或 short 修饰符的前缀。例如: unsigned long int 。 C++ 允许使用速记符号来声明 无符号短整数 或 无符号长整数 。您可以不写 int,只写单词 unsigned、short 或 unsigned、long ,int 是隐含的。 C++ 中的类型限定符 类型限定符提供了变量的额外信息。 限定符 含义 const const 类型的对象在程序执行期间不能被修改改变。 volatile 修饰符 volatile 告诉编译器,变量的值可能以程序未明确指定的方式被改变。 restrict 由 restrict 修饰的指针是唯一一种访问它所指向的对象的方式。只有 C99 增加了新的类型限定符 restrict。 C++提供了关键字explicit,可以阻止不应该允许的经过转换构造函数进行的隐式转换的发生

Linux操作系统 进程之间的通信

孤人 提交于 2019-12-20 18:13:45
进程之间的通信 预备知识: 1、用户态和内核态,当一个进程在执行用户自己的代码时处于用户运行态(用户态);当一个进程因为系统调用陷入内核代码中执行时处于内核运行态(内核态)。 2、进程之间的通信(Inter Processs Communication- IPC )实现机制有:管道、消息队列、信号值、信号、共享内存、共享映射文件、套接字等。 3、及时通信:信号(类似中断);非及时通信:共享内存、邮箱、管道、套接字、 4、常见的信号:终止信号、定时器信号、用户自定义信号等 5、信号: 用户、系统或者进程 发送给 目标进程 的 信息 ,以通知目标进程某个 状态的改变 或 系统异常 。 6、 PCB(progress control block- 进程控制块),系统通过PCB,描述进程和控制进程。在Linux系统下,PCB是 task_struct结构体(进程描述符) 。   1、 进程状态 :记录进程是处于运行状态还是等待状态   2、 调度信息 :进程由哪个函数调度,具体怎样调度等   3、进程之间的 通讯状况   4、进程之间的 亲属关系 :在父进程和子进程之间有task_struct类型的指针,将父进程和子进程联系起来   5、 时间数据信息 :每个进程执行所占用CPU的时间   6、 进程的标志   7、 进程的标识符 :该进程唯一的标识符用来区别其他进程   8、

MySQL C API

限于喜欢 提交于 2019-12-20 08:51:44
一、数据类型 MYSQL MYSQL 是MYSQL数据库连接的句柄(handle),几乎所有的MYSQL函数都需使用该 数据结构, 不要尝试去复制该数据结构,因为不能保证副本是可用的 。 MYSQL_RES MYSQL_RES 是SQL查询结果(result of query)。 MYSQL_ROW MYSQL_ROW 代表着一行数据,它被实现可数字节的字符串(an array of counted byte strings), 但是认为它是以null为终结符的字符串 ,因为它可能包含二进制 数据。一行数据通常通过 mysql_fetch_row() 来获取。 MYSQL_FIELD MYSQL_FIELD 包含元数据 metadata ,字段的信息(例如字段名,数据类型,大小等) 通常可以通过重复使用 mysql_fetch_field 逐个获取字段,但字段值不包括在这个结构 中,而是包含在 MYSQL_ROW . MYSQL_FIELD的数据成员,当使用在不同场合,它的数据成员有不同含义: char* name : char* org_name : char* table : char* org_name : char* db : char* catlog : char* def : unsigned long length : unsigned long max_length

should use size_t or ssize_t [duplicate]

本秂侑毒 提交于 2019-12-20 08:01:39
问题 This question already has answers here : Signed vs. unsigned integers for lengths/counts (4 answers) Closed 6 years ago . At my code, I do not use int or unsigned int. I only use size_t or ssize_t for portable. For example: typedef size_t intc; // (instead of unsigned int) typedef ssize_t uintc; // (instead of int) Because strlen , string , vector ... all use size_t , so I usually use size_t . And I only use ssize_t when it may be negative. But I find that: The unsigned integer types are

C What happens when casting floating point types to unsigned integer types when the value would overflow

本秂侑毒 提交于 2019-12-20 03:18:17
问题 I'm wondering what happens when casting from a floating point type to an unsigned integer type in C when the value can't be accurately represented by the integer type in question. Take for instance func (void) { float a = 1E10; unsigned b = a; } The value of b I get on my system (with unsigned on my system being able to represent values from 0 to 2^32-1) is 1410065408 . This seems sensible to me because it's simply the lowest order bits of the result of the cast. I believe the behavior of

How to quadruple an unsigned number using bit-wise and logic operator in C

懵懂的女人 提交于 2019-12-19 05:02:11
问题 Goal: 4x ( 4.400000095 ) = 17.60000038 Legal ops: Any integer/unsigned operations incl. ||, &&. also if, while Max ops: 30 Return bit-level equivalent of expression x + x + x + x for floating point argument f. My code: unsigned 4x(unsigned uf) { unsigned expn = (uf >> 23) & 0xFF; unsigned sign = uf & 0x80000000; unsigned frac = uf & 0x007FFFFF; if (expn == 255 || (expn == 0 && frac == 0)) return uf; if (expn) { expn << 2; } else if (frac == 0x7FFFFF) { frac >> 2; expn << 2; } else { frac <<=

How to quadruple an unsigned number using bit-wise and logic operator in C

℡╲_俬逩灬. 提交于 2019-12-19 05:02:01
问题 Goal: 4x ( 4.400000095 ) = 17.60000038 Legal ops: Any integer/unsigned operations incl. ||, &&. also if, while Max ops: 30 Return bit-level equivalent of expression x + x + x + x for floating point argument f. My code: unsigned 4x(unsigned uf) { unsigned expn = (uf >> 23) & 0xFF; unsigned sign = uf & 0x80000000; unsigned frac = uf & 0x007FFFFF; if (expn == 255 || (expn == 0 && frac == 0)) return uf; if (expn) { expn << 2; } else if (frac == 0x7FFFFF) { frac >> 2; expn << 2; } else { frac <<=

C++数据类型

我怕爱的太早我们不能终老 提交于 2019-12-18 22:54:54
学了C然后C++,然后MFC/Windows,然后是C#,其中数据类型很多,由基本类型衍生的typedef类型也N多。熟知基本数据类型是我们正确表达实际问题中各种数据的前提,因此我分类总结了一下C/C++/Windows /C#基本数据类型,以便日后查阅。 ANSI C/C++基本数据类型: Type Size 数值范围 无值型void 0 byte 无值域 布尔型bool 1 byte true false 有符号短整型short [int] /signed short [int] 2 byte -32768~32767 无符号短整型unsigned short [int] 2 byte 0~65535 有符号整型int /signed [int] 4 byte -2147483648~2147483647 无符号整型unsigned [int] 4 byte 0~4294967295 有符号长整型long [int]/signed long [int] 4 byte -2147483648~2147483647 无符号长整型unsigned long [int] 4 byte 0~4294967295 long long 8 byte 0~18446744073709552000 有符号字符型char/signed char 1 byte -128~127