Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
[SysApps] Expose ffmpeg function signatures needed by Device Capabili…
Browse files Browse the repository at this point in the history
…ties API

We need these functions in to get the list of Codecs available in the
system for getAVCodecs(). If we ever fork ffmpeg, we can just remove
this patch and add the signatures directly at the ffmpeg's signature
list.
  • Loading branch information
Thiago Marcos P. Santos authored and Maksim Sisov committed Aug 16, 2016
1 parent 4f969c0 commit 1169e1e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
23 changes: 22 additions & 1 deletion tools/generate_stubs/generate_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def ExtractModuleName(infile_path):
return basename


def ParseSignatures(infile):
def ParseSignaturesReal(infile):
"""Parses function signatures in the input file.
This function parses a file of signatures into a list of dictionaries that
Expand Down Expand Up @@ -426,6 +426,27 @@ def ParseSignatures(infile):
return signatures


# Sometimes additional signatures other than what is exposed to Chromium are
# needed, in particular for ffmpeg. If we ever make a fork of ffmpeg, is
# probably a good idea to remove this patch and add the signatures directly on
# the .sigs file at the dependency repository. In order to expose additional
# signatures of a library foobar, just add a .sig file prefixed with "xwalk_" at
# the root folder of the directory containing this script.
def ParseSignatures(infile):
signatures = ParseSignaturesReal(infile)

xwalk_sig_dir = os.path.dirname(os.path.realpath(__file__))
xwalk_sig_file = os.path.join(xwalk_sig_dir,
'xwalk_' + os.path.basename(infile.name))

if os.path.exists(xwalk_sig_file):
xwalk_infile = open(xwalk_sig_file, 'r')
signatures += ParseSignaturesReal(xwalk_infile)
xwalk_infile.close()

return signatures


def WriteWindowsDefFile(module_name, signatures, outfile):
"""Writes a windows def file to the given output file object.
Expand Down
7 changes: 7 additions & 0 deletions tools/generate_stubs/xwalk_ffmpegsumo.sigs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright (c) 2013 Intel Corporation. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

AVCodec *av_codec_next(const AVCodec *c);
int av_codec_is_encoder(const AVCodec *c);
int av_codec_is_decoder(const AVCodec *c);

0 comments on commit 1169e1e

Please sign in to comment.