我正在尝试在 cygwin 环境下在 ffmpeg 中编译 libx264。
我遵循了来自Koohiimaster 博客、FFMPEG 编译指南、SO post 1、SO post 2 的几个来源的一些指示,但我总是停留在同一步骤,即 libx264 编译(制作)过程。
如 FFMPEG 编译指南中所述,应遵循这些步骤以使 libx264 正常工作
cd ~/ffmpeg_sources
wget http://download.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
tar xjvf last_x264.tar.bz2
cd x264-snapshot*
PATH="$HOME/bin:$PATH" ./configure --prefix="$HOME/ffmpeg_build" bindir="$HOME/bin" --enable-static --disable-opencl
PATH="$HOME/bin:$PATH" make
make install
Run Code Online (Sandbox Code Playgroud)
但是当我输入此命令时PATH="$HOME/bin:$PATH" make
,编译器总是会因以下错误而停止:
In file included from input/avs.c:49:0:
./extras/avisynth_c.h:825:3: error: unknown type name ‘HMODULE’
HMODULE handle;
^
Run Code Online (Sandbox Code Playgroud)
我想知道这是否是 libx264 源的错误,但在我尝试了几个早期的源版本后,它产生了同样的错误。有什么想法可以解决这个问题吗?
我想通过 kotlin 扩展一个具有良好委托功能的库,但我陷入了一个地方,我想将两个不同的接口委托给同一个 impl。问题是,这两个接口具有共同的方法(一个扩展了另一个)。
所以存在一个由和接口Base
扩展的接口。而 a实现了和,实际上库中有很多类似的实现和接口。ExtendedBase
Foo1
Foo1Impl
Foo
ExtendedBase
interface Base: {
fun doBase()
fun doBase2()
// .. lots of methods
fun doBaseN()
}
interface ExtendedBase: Base {
fun doExtended()
fun doExtended2()
// .. lots of methods
fun doExtendedN()
}
interface Foo1: Base {
fun doFoo1()
}
class Foo1Impl: Foo1, ExtendedBase {
// some impl for doBase, doExtended and doFoo1
}
interface Foo2: Base {
fun doFoo2()
}
class Foo2Impl: Foo2, ExtendedBase {
// …
Run Code Online (Sandbox Code Playgroud) 有人告诉我,回答我的最后一个问题是
char *name[] = {"xxx", "yyy"}
Run Code Online (Sandbox Code Playgroud)
由编译器更改为
char *name[] = {Some_Pointer, Some_Other_Pointer};
Run Code Online (Sandbox Code Playgroud)
我尝试了以下内容来理解:
printf("%p\n", &name);
printf("%p\n", name);
printf("%s\n", *name);
printf("%c\n", **name);
Run Code Online (Sandbox Code Playgroud)
所以作为输出它给了我:
0xfff0000f0
0xfff0000f0
xxx
x
Run Code Online (Sandbox Code Playgroud)
你能解释一下指针"name"的地址如何与指针"name"所指向的地址相同吗?根据我的理解,指针"name"本身占用8个字节.如何在内存中占用4个字节的第一个字符串"xxx"与指针位于同一位置?
我经常遇到创建对象集合的String表示的任务.
例:
String[] collection = {"foo", "bar", "lorem", "dolar"};
Run Code Online (Sandbox Code Playgroud)
我要创建的表示:"foo,bar,lorem,dolar".
每当我遇到这个任务时,我都想知道哪种方法能够达到理想的效果.
我知道有很多方法可以获得所需的表示,但是例如我总是想知道,如果有可能通过使用for/each循环来创建字符串?
像这样:
StringBuilder builder = new StringBuilder();
for (String tag : list) {
builder.append(tag + ", ");
String representation = builder.toString();
// but now the String look like this: "foo, bar, lorem, dolar, " which nobody wants
Run Code Online (Sandbox Code Playgroud)
或者最好直接使用迭代器(如果有的话)?
假设list是一个集合(这就是它们在JDK中的表现方式):
Iterator<String> it = list.iterator();
while (it.hasNext()) {
sb.append(it.next());
if (!it.hasNext()) {
break;
}
sb.append(", ");
}
Run Code Online (Sandbox Code Playgroud)
当然,人们可以使用传统的for循环索引数组或执行许多其他操作.
将字符串列表转换为用逗号分隔每个元素的表示的最简单/最佳可读/最安全的方法是什么,并在开头或结尾处理边缘情况 …
标题"main.h"定义了以下变量:
#define FRAMERATE 60.0f
#define RES_WIDTH 1920.0f
#define RES_HEIGHT 1080.0f
#define RATIO_X 16.0f
#define RATIO_Y 9.0f
#define INCH 27.0f
#define HEIGHT sqrt( pow(INCH,2.0f) / (pow((RATIO_X/RATIO_Y),2.0f) + 1.0f) ) * 2.54f
#define WIDTH (RATIO_X * HEIGHT) / RATIO_Y
#define PPCM RES_WIDTH / WIDTH
#define SEC 60.0f
Run Code Online (Sandbox Code Playgroud)
问题可视化的测试代码:
float speed = 1.0f; // Pixle / Frame
printf("SEC: %f\n", SEC); // Frames per Second
printf("PPCM: %f\n", PPCM); // Pixle per centimeter
printf("1. Speed (CM/SEC): %f\n", (speed * SEC) / PPCM ); // speed …
Run Code Online (Sandbox Code Playgroud)