#18: use get_stream_spec_nodes in view

This commit is contained in:
Karl Kroening 2017-07-09 16:00:41 -06:00
parent 4af484feee
commit 2d6b0d4730

View File

@ -8,7 +8,7 @@ import tempfile
from ffmpeg.nodes import ( from ffmpeg.nodes import (
FilterNode, FilterNode,
get_stream_map, get_stream_spec_nodes,
InputNode, InputNode,
OutputNode, OutputNode,
Stream, Stream,
@ -44,12 +44,7 @@ def view(stream_spec, **kwargs):
if filename is None: if filename is None:
filename = tempfile.mktemp() filename = tempfile.mktemp()
nodes = [] nodes = get_stream_spec_nodes(stream_spec)
stream_map = get_stream_map(stream_spec)
for stream in stream_map.values():
if not isinstance(stream, Stream):
raise TypeError('Expected Stream; got {}'.format(type(stream)))
nodes.append(stream.node)
sorted_nodes, outgoing_edge_maps = topo_sort(nodes) sorted_nodes, outgoing_edge_maps = topo_sort(nodes)
graph = graphviz.Digraph() graph = graphviz.Digraph()