Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions luajit/examples/extract_pic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require "upipe-framers"
require "upipe-filters"
require "upipe-swscale"

local UPROBE_LOG_LEVEL = UPROBE_LOG_INFO
local UPROBE_LOG_LEVEL = 'UPROBE_LOG_INFO'

local src_path = assert(arg[1])
local dst_path = assert(arg[2])
Expand All @@ -27,9 +27,7 @@ local null = upipe.null():new(pfx("null") .. probe)

-- file source
local source = upipe.fsrc():new(pfx("src") .. probe)
if not ubase_check(source:set_uri(src_path)) then
os.exit(1)
end
source.uri = src_path

local split_pipe

Expand Down Expand Up @@ -58,7 +56,7 @@ local avcdec_probe = uprobe {
local sar = flow_def:pic_flow_get_sar()
if not hsize or not sar then
pipe:err_va("incompatible flow def")
return "unhandled"
return 'unhandled'
end

local wanted_hsize = (hsize * sar.num / sar.den / 2) * 2
Expand Down Expand Up @@ -86,7 +84,7 @@ local avcdec_probe = uprobe {
probe)

local fsink = upipe.fsink():new(pfx("sink") .. probe)
fsink:fsink_set_path(dst_path, "UPIPE_FSINK_OVERWRITE")
ubase_assert(fsink:fsink_set_path(dst_path, 'UPIPE_FSINK_OVERWRITE'))

pipe.output = ffmt .. jpegenc .. urefprobe .. fsink
end
Expand All @@ -110,8 +108,8 @@ ts_demux_mgr.autof_mgr = upipe.autof()

source.output = ts_demux_mgr:new(
pfx("ts demux") ..
uprobe.selflow(UPROBE_SELFLOW_VOID, "auto",
uprobe.selflow(UPROBE_SELFLOW_PIC, "auto",
uprobe.selflow('UPROBE_SELFLOW_VOID', "auto",
uprobe.selflow('UPROBE_SELFLOW_PIC', "auto",
split_probe ..
probe) ..
probe) ..
Expand Down
13 changes: 5 additions & 8 deletions luajit/examples/upipe_duration.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require "upipe-modules"
require "upipe-ts"
require "upipe-framers"

local UPROBE_LOG_LEVEL = UPROBE_LOG_INFO
local UPROBE_LOG_LEVEL = 'UPROBE_LOG_INFO'

if #arg ~= 1 then
io.stderr:write("Usage: ", arg[0], " <filename>\n")
Expand Down Expand Up @@ -46,10 +46,7 @@ end

-- pipes
local src = upipe.fsrc():new(pfx("src") .. probe)
if not ubase_check(src:set_uri(file)) then
io.stderr:write("invalid file\n")
os.exit(1)
end
src.uri = file

local sink = count_mgr:new(pfx("count") .. probe)

Expand All @@ -58,10 +55,10 @@ ts_demux_mgr.autof_mgr = upipe.autof()

src.output = ts_demux_mgr:new(
pfx("ts demux") ..
uprobe.selflow(UPROBE_SELFLOW_VOID, "auto",
uprobe.selflow(UPROBE_SELFLOW_PIC, "auto",
uprobe.selflow('UPROBE_SELFLOW_VOID', "auto",
uprobe.selflow('UPROBE_SELFLOW_PIC', "auto",
uprobe {
new_flow_def = function (probe, pipe, flow_def)
need_output = function (probe, pipe, flow_def)
pipe.output = sink
end } ..
probe) ..
Expand Down
4 changes: 2 additions & 2 deletions luajit/examples/upipe_http_get.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require "upump-ev"
require "upipe-modules"
require "upipe-openssl"

local UPROBE_LOG_LEVEL = UPROBE_LOG_INFO
local UPROBE_LOG_LEVEL = 'UPROBE_LOG_INFO'

if #arg ~= 1 then
io.stderr:write("Usage: ", arg[0], " <url>\n")
Expand All @@ -25,7 +25,7 @@ end

-- pipes
local sink = upipe.fsink():new(pfx("sink") .. probe)
ubase_assert(sink:fsink_set_path("/dev/stdout", "UPIPE_FSINK_OVERWRITE"))
ubase_assert(sink:fsink_set_path("/dev/stdout", 'UPIPE_FSINK_OVERWRITE'))

local src = upipe.http_src():new(pfx("http") .. probe_https .. probe)
src.uri = url
Expand Down
6 changes: 3 additions & 3 deletions luajit/examples/upipe_xor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ local upipe = require "upipe"
require "upump-ev"
require "upipe-modules"

local UPROBE_LOG_LEVEL = UPROBE_LOG_INFO
local UPROBE_LOG_LEVEL = 'UPROBE_LOG_INFO'

if #arg ~= 2 then
io.stderr:write("Usage: ", arg[0], " <input> <output>\n")
Expand Down Expand Up @@ -50,7 +50,7 @@ local upipe_xor_mgr = upipe {
control = {
set_flow_def = function (pipe, flow_def)
if not ubase_check(flow_def:flow_match_def("block.")) then
return "invalid"
return 'invalid'
end
pipe:helper_store_flow_def(flow_def:dup())
end
Expand All @@ -70,7 +70,7 @@ local xor = upipe_xor_mgr:new(pfx "xor")
local sink = upipe.fsink():new(pfx "sink")

src.uri = input
ubase_assert(sink:fsink_set_path(output, "UPIPE_FSINK_OVERWRITE"))
ubase_assert(sink:fsink_set_path(output, 'UPIPE_FSINK_OVERWRITE'))
src.output = xor .. sink

-- main loop
Expand Down
Loading