使用vscode调试ffmpeg源码

ffmpeg的编译配置

# --enable-debug 设置为调试级别
# --disable-stripping 如果不加此选项,会strip去掉符号信息
./configure --prefix={output_path} --enable-debug --disable-stripping
make -j10
VSCode的配置

将以下文件对比替换工程.vscode目录下的相同文件

  • launch.json
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "debug_ffmpeg",
      "type": "cppdbg",
      "request": "launch",
      "program": "${workspaceFolder}/../offical_ffmpeg/debug/bin/${fileBasenameNoExtension}",
      "args": [
        "-i",
        "http://xxx/test_shot_hls.m3u8",
        "-r",
        "1.00",
        "-f",
        "image2",
        "/Users/admin/test_output/live_%06d.jpeg"
      ],
      "stopAtEntry": false,
      "cwd": "${workspaceFolder}/",
      "environment": [],
      "externalConsole": false,
      "launchCompleteCommand": "exec-run",
      "linux": {
        "MIMode": "gdb",
        "miDebuggerPath": "/usr/bin/gdb"
      },
      "osx": {
        "MIMode": "lldb"
      },
      "windows": {
        "MIMode": "gdb",
        "miDebuggerPath": "C:\\MinGw\\bin\\gdb.exe"
      },
      "preLaunchTask": "precompile_ffmpeg",
      "sourceFileMap": {
        "/proc/self/cwd/ffmpeg-src": "${workspaceFolder}/../offical_ffmpeg"
      }
    },
    {
      "name": "debug_ffmpeg_examples",
      "type": "cppdbg",
      "request": "launch",
      "program": "${workspaceFolder}/../offical_ffmpeg/doc/examples/${fileBasenameNoExtension}",
      "args": [
        "1.aac"
      ],
      "stopAtEntry": false,
      "cwd": "${workspaceFolder}/",
      "environment": [],
      "externalConsole": false,
      "launchCompleteCommand": "exec-run",
      "linux": {
        "MIMode": "gdb",
        "miDebuggerPath": "/usr/bin/gdb"
      },
      "osx": {
        "MIMode": "lldb"
      },
      "windows": {
        "MIMode": "gdb",
        "miDebuggerPath": "C:\\MinGw\\bin\\gdb.exe"
      },
      "preLaunchTask": "precompile_ffmpeg_examples",
      "sourceFileMap": {
        "/proc/self/cwd/ffmpeg-src": "${workspaceFolder}/../offical_ffmpeg"
      }
    }
  ]
}
  • tasks.json
{
  "tasks": [
    {
      "label": "precompile_ffmpeg",
      "type": "shell",
      "command": "cd ${workspaceFolder} && make -j16"
    },
    {
      "label": "precompile_ffmpeg_examples",
      "type": "shell",
      "command": "cd ${workspaceFolder} && make examples -j16"
    }
  ],
  "version": "2.0.0"
}
  • settings.json
{
  "files.associations": {
    "*.ipp": "cc",
    "any": "cpp",
    "array": "cpp",
    "atomic": "cpp",
    "bit": "cpp",
    "*.tcc": "cpp",
    "bitset": "cpp",
    "cctype": "cpp",
    "chrono": "cpp",
    "clocale": "cpp",
    "cmath": "cpp",
    "codecvt": "cpp",
    "complex": "cpp",
    "condition_variable": "cpp",
    "csignal": "cpp",
    "cstdarg": "cpp",
    "cstddef": "cpp",
    "cstdint": "cpp",
    "cstdio": "cpp",
    "cstdlib": "cpp",
    "cstring": "cpp",
    "ctime": "cpp",
    "cwchar": "cpp",
    "cwctype": "cpp",
    "deque": "cpp",
    "forward_list": "cpp",
    "list": "cpp",
    "map": "cpp",
    "set": "cpp",
    "unordered_map": "cpp",
    "unordered_set": "cpp",
    "vector": "cpp",
    "exception": "cpp",
    "string_view": "cpp",
    "fstream": "cpp",
    "functional": "cpp",
    "future": "cpp",
    "initializer_list": "cpp",
    "iomanip": "cpp",
    "iosfwd": "cpp",
    "iostream": "cpp",
    "istream": "cpp",
    "limits": "cpp",
    "memory": "cpp",
    "mutex": "cpp",
    "new": "cpp",
    "numeric": "cpp",
    "optional": "cpp",
    "ostream": "cpp",
    "ratio": "cpp",
    "sstream": "cpp",
    "stdexcept": "cpp",
    "streambuf": "cpp",
    "string": "cpp",
    "system_error": "cpp",
    "thread": "cpp",
    "type_traits": "cpp",
    "tuple": "cpp",
    "typeindex": "cpp",
    "typeinfo": "cpp",
    "utility": "cpp",
    "valarray": "cpp",
    "variant": "cpp",
    "data_type_def.h": "c",
    "ctype.h": "c"
  },
  "cmake.sourceDirectory": "${workspaceFolder}"
}
  • c_cpp_properties.json
{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "clang-x64",
            "configurationProvider": "ms-vscode.makefile-tools"
        },
        {
            "name": "Mac",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "macFrameworkPath": [
                "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"
            ],
            "compilerPath": "/usr/bin/clang",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "clang-x64"
        }
    ],
    "version": 4
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值