-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_codec_names.cpp
More file actions
67 lines (59 loc) · 1.04 KB
/
Copy pathtest_codec_names.cpp
File metadata and controls
67 lines (59 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <sys/time.h>
#include <fcntl.h>
#include <pthread.h>
#include <semaphore.h>
#include <iostream>
#include <string>
#include <memory>
#include <thread>
#include <chrono>
extern "C"
{
#include <libavutil/avassert.h>
#include <libavutil/channel_layout.h>
#include <libavutil/opt.h>
#include <libavutil/mathematics.h>
#include <libavutil/timestamp.h>
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
#include <libswscale/swscale.h>
#include <libswresample/swresample.h>
}
#include "muxer.h"
long int precise_time()
{
struct timeval tv;
gettimeofday(&tv, NULL);
long int ts = (tv.tv_sec * 1000000) + tv.tv_usec;
return(ts);
}
void strip_lf(char *cp)
{
while(*cp != '\0')
{
if((*cp == 10) || (*cp == 13))
{
*cp = '\0';
}
cp++;
}
}
int main()
{
char buf[256];
while(fgets(buf, 255, stdin))
{
strip_lf(buf);
int nn = codec_by_name(buf);
if(nn != 0)
{
printf("% 20s\t%d\n", buf, nn);
}
}
}