<?xml version="1.0" encoding="ascii"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>flumotion.component.encoders.jpeg.jpeg</title> <link rel="stylesheet" href="epydoc.css" type="text/css" /> <script type="text/javascript" src="epydoc.js"></script> </head> <body bgcolor="white" text="black" link="blue" vlink="#204080" alink="#204080"> <!-- ==================== NAVIGATION BAR ==================== --> <table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> <tr valign="middle"> <!-- Tree link --> <th> <a href="module-tree.html">Trees</a> </th> <!-- Index link --> <th> <a href="identifier-index.html">Indices</a> </th> <!-- Help link --> <th> <a href="help.html">Help</a> </th> <th class="navbar" width="100%"></th> </tr> </table> <table width="100%" cellpadding="0" cellspacing="0"> <tr valign="top"> <td width="100%"> <span class="breadcrumbs"> Package flumotion :: <a href="flumotion.component-module.html">Package component</a> :: <a href="flumotion.component.encoders-module.html">Package encoders</a> :: <a href="flumotion.component.encoders.jpeg-module.html">Package jpeg</a> :: Module jpeg </span> </td> <td> <table cellpadding="0" cellspacing="0"> <!-- hide/show private --> <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink" onclick="toggle_private();">hide private</a>]</span></td></tr> </table> </td> </tr> </table> <h1 class="epydoc">Source Code for <a href="flumotion.component.encoders.jpeg.jpeg-module.html">Module flumotion.component.encoders.jpeg.jpeg</a></h1> <pre class="py-src"> <a name="L1"></a><tt class="py-lineno"> 1</tt> <tt class="py-line"><tt class="py-comment"># -*- Mode: Python -*-</tt> </tt> <a name="L2"></a><tt class="py-lineno"> 2</tt> <tt class="py-line"><tt class="py-comment"># vi:si:et:sw=4:sts=4:ts=4</tt> </tt> <a name="L3"></a><tt class="py-lineno"> 3</tt> <tt class="py-line"><tt class="py-comment">#</tt> </tt> <a name="L4"></a><tt class="py-lineno"> 4</tt> <tt class="py-line"><tt class="py-comment"># Flumotion - a streaming media server</tt> </tt> <a name="L5"></a><tt class="py-lineno"> 5</tt> <tt class="py-line"><tt class="py-comment"># Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com).</tt> </tt> <a name="L6"></a><tt class="py-lineno"> 6</tt> <tt class="py-line"><tt class="py-comment"># All rights reserved.</tt> </tt> <a name="L7"></a><tt class="py-lineno"> 7</tt> <tt class="py-line"> </tt> <a name="L8"></a><tt class="py-lineno"> 8</tt> <tt class="py-line"><tt class="py-comment"># This file may be distributed and/or modified under the terms of</tt> </tt> <a name="L9"></a><tt class="py-lineno"> 9</tt> <tt class="py-line"><tt class="py-comment"># the GNU General Public License version 2 as published by</tt> </tt> <a name="L10"></a><tt class="py-lineno">10</tt> <tt class="py-line"><tt class="py-comment"># the Free Software Foundation.</tt> </tt> <a name="L11"></a><tt class="py-lineno">11</tt> <tt class="py-line"><tt class="py-comment"># This file is distributed without any warranty; without even the implied</tt> </tt> <a name="L12"></a><tt class="py-lineno">12</tt> <tt class="py-line"><tt class="py-comment"># warranty of merchantability or fitness for a particular purpose.</tt> </tt> <a name="L13"></a><tt class="py-lineno">13</tt> <tt class="py-line"><tt class="py-comment"># See "LICENSE.GPL" in the source distribution for more information.</tt> </tt> <a name="L14"></a><tt class="py-lineno">14</tt> <tt class="py-line"> </tt> <a name="L15"></a><tt class="py-lineno">15</tt> <tt class="py-line"><tt class="py-comment"># Licensees having purchased or holding a valid Flumotion Advanced</tt> </tt> <a name="L16"></a><tt class="py-lineno">16</tt> <tt class="py-line"><tt class="py-comment"># Streaming Server license may use this file in accordance with the</tt> </tt> <a name="L17"></a><tt class="py-lineno">17</tt> <tt class="py-line"><tt class="py-comment"># Flumotion Advanced Streaming Server Commercial License Agreement.</tt> </tt> <a name="L18"></a><tt class="py-lineno">18</tt> <tt class="py-line"><tt class="py-comment"># See "LICENSE.Flumotion" in the source distribution for more information.</tt> </tt> <a name="L19"></a><tt class="py-lineno">19</tt> <tt class="py-line"> </tt> <a name="L20"></a><tt class="py-lineno">20</tt> <tt class="py-line"><tt class="py-comment"># Headers in this file shall remain intact.</tt> </tt> <a name="L21"></a><tt class="py-lineno">21</tt> <tt class="py-line"> </tt> <a name="L22"></a><tt class="py-lineno">22</tt> <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">flumotion</tt><tt class="py-op">.</tt><tt id="link-0" class="py-name" targets="Module flumotion.admin.command.component=flumotion.admin.command.component-module.html,Package flumotion.component=flumotion.component-module.html,Module flumotion.component.bouncers.component=flumotion.component.bouncers.component-module.html,Module flumotion.component.component=flumotion.component.component-module.html,Module flumotion.manager.component=flumotion.manager.component-module.html"><a title="flumotion.admin.command.component flumotion.component flumotion.component.bouncers.component flumotion.component.component flumotion.manager.component" class="py-name" href="#" onclick="return doclink('link-0', 'component', 'link-0');">component</a></tt> <tt class="py-keyword">import</tt> <tt id="link-1" class="py-name" targets="Module flumotion.component.feedcomponent=flumotion.component.feedcomponent-module.html"><a title="flumotion.component.feedcomponent" class="py-name" href="#" onclick="return doclink('link-1', 'feedcomponent', 'link-1');">feedcomponent</a></tt> </tt> <a name="L23"></a><tt class="py-lineno">23</tt> <tt class="py-line"> </tt> <a name="L24"></a><tt class="py-lineno">24</tt> <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">gst</tt> </tt> <a name="L25"></a><tt class="py-lineno">25</tt> <tt class="py-line"> </tt> <a name="L26"></a><tt class="py-lineno">26</tt> <tt class="py-line"><tt class="py-name">__version__</tt> <tt class="py-op">=</tt> <tt class="py-string">"$Rev: 7161 $"</tt> </tt> <a name="L27"></a><tt class="py-lineno">27</tt> <tt class="py-line"> </tt> <a name="L28"></a><tt class="py-lineno">28</tt> <tt class="py-line"> </tt> <a name="JPEG"></a><div id="JPEG-def"><a name="L29"></a><tt class="py-lineno">29</tt> <a class="py-toggle" href="#" id="JPEG-toggle" onclick="return toggle('JPEG');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="flumotion.component.encoders.jpeg.jpeg.JPEG-class.html">JPEG</a><tt class="py-op">(</tt><tt class="py-base-class">feedcomponent</tt><tt class="py-op">.</tt><tt class="py-base-class">ParseLaunchComponent</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt> </div><div id="JPEG-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="JPEG-expanded"><a name="L30"></a><tt class="py-lineno">30</tt> <tt class="py-line"> </tt> <a name="JPEG.get_pipeline_string"></a><div id="JPEG.get_pipeline_string-def"><a name="L31"></a><tt class="py-lineno">31</tt> <a class="py-toggle" href="#" id="JPEG.get_pipeline_string-toggle" onclick="return toggle('JPEG.get_pipeline_string');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="flumotion.component.encoders.jpeg.jpeg.JPEG-class.html#get_pipeline_string">get_pipeline_string</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">properties</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt> </div><div id="JPEG.get_pipeline_string-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="JPEG.get_pipeline_string-expanded"><a name="L32"></a><tt class="py-lineno">32</tt> <tt class="py-line"> <tt class="py-name">framerate</tt> <tt class="py-op">=</tt> <tt class="py-string">''</tt> </tt> <a name="L33"></a><tt class="py-lineno">33</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-string">'framerate'</tt> <tt class="py-keyword">in</tt> <tt id="link-2" class="py-name" targets="Variable flumotion.launch.parse.Component.properties=flumotion.launch.parse.Component-class.html#properties"><a title="flumotion.launch.parse.Component.properties" class="py-name" href="#" onclick="return doclink('link-2', 'properties', 'link-2');">properties</a></tt><tt class="py-op">:</tt> </tt> <a name="L34"></a><tt class="py-lineno">34</tt> <tt class="py-line"> <tt class="py-name">frac</tt> <tt class="py-op">=</tt> <tt id="link-3" class="py-name"><a title="flumotion.launch.parse.Component.properties" class="py-name" href="#" onclick="return doclink('link-3', 'properties', 'link-2');">properties</a></tt><tt class="py-op">[</tt><tt class="py-string">'framerate'</tt><tt class="py-op">]</tt> </tt> <a name="L35"></a><tt class="py-lineno">35</tt> <tt class="py-line"> <tt class="py-name">framerate</tt> <tt class="py-op">=</tt> <tt class="py-string">'(fraction)%d/%d'</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">frac</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-name">frac</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt> <a name="L36"></a><tt class="py-lineno">36</tt> <tt class="py-line"> </tt> <a name="L37"></a><tt class="py-lineno">37</tt> <tt class="py-line"> <tt class="py-name">framerate</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-string">' ! videorate ! video/x-raw-yuv,framerate=%s '</tt> </tt> <a name="L38"></a><tt class="py-lineno">38</tt> <tt class="py-line"> <tt class="py-op">%</tt> <tt class="py-name">framerate</tt><tt class="py-op">)</tt> </tt> <a name="L39"></a><tt class="py-lineno">39</tt> <tt class="py-line"> </tt> <a name="L40"></a><tt class="py-lineno">40</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-string">'ffmpegcolorspace %s ! jpegenc name=encoder'</tt> <tt class="py-op">%</tt> <tt class="py-name">framerate</tt> </tt> </div><a name="L41"></a><tt class="py-lineno">41</tt> <tt class="py-line"> </tt> <a name="JPEG.configure_pipeline"></a><div id="JPEG.configure_pipeline-def"><a name="L42"></a><tt class="py-lineno">42</tt> <a class="py-toggle" href="#" id="JPEG.configure_pipeline-toggle" onclick="return toggle('JPEG.configure_pipeline');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="flumotion.component.encoders.jpeg.jpeg.JPEG-class.html#configure_pipeline">configure_pipeline</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">pipeline</tt><tt class="py-op">,</tt> <tt class="py-param">properties</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt> </div><div id="JPEG.configure_pipeline-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="JPEG.configure_pipeline-expanded"><a name="L43"></a><tt class="py-lineno">43</tt> <tt class="py-line"> <tt class="py-name">element</tt> <tt class="py-op">=</tt> <tt id="link-4" class="py-name" targets="Package flumotion.component.converters.pipeline=flumotion.component.converters.pipeline-module.html,Module flumotion.component.converters.pipeline.pipeline=flumotion.component.converters.pipeline.pipeline-module.html,Package flumotion.component.producers.pipeline=flumotion.component.producers.pipeline-module.html,Module flumotion.component.producers.pipeline.pipeline=flumotion.component.producers.pipeline.pipeline-module.html,Variable flumotion.worker.checks.gst010.BusResolution.pipeline=flumotion.worker.checks.gst010.BusResolution-class.html#pipeline"><a title="flumotion.component.converters.pipeline flumotion.component.converters.pipeline.pipeline flumotion.component.producers.pipeline flumotion.component.producers.pipeline.pipeline flumotion.worker.checks.gst010.BusResolution.pipeline" class="py-name" href="#" onclick="return doclink('link-4', 'pipeline', 'link-4');">pipeline</a></tt><tt class="py-op">.</tt><tt class="py-name">get_by_name</tt><tt class="py-op">(</tt><tt class="py-string">'encoder'</tt><tt class="py-op">)</tt> </tt> <a name="L44"></a><tt class="py-lineno">44</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-string">'quality'</tt> <tt class="py-keyword">in</tt> <tt id="link-5" class="py-name"><a title="flumotion.launch.parse.Component.properties" class="py-name" href="#" onclick="return doclink('link-5', 'properties', 'link-2');">properties</a></tt><tt class="py-op">:</tt> </tt> <a name="L45"></a><tt class="py-lineno">45</tt> <tt class="py-line"> <tt class="py-name">element</tt><tt class="py-op">.</tt><tt class="py-name">set_property</tt><tt class="py-op">(</tt><tt class="py-string">'quality'</tt><tt class="py-op">,</tt> <tt id="link-6" class="py-name"><a title="flumotion.launch.parse.Component.properties" class="py-name" href="#" onclick="return doclink('link-6', 'properties', 'link-2');">properties</a></tt><tt class="py-op">[</tt><tt class="py-string">'quality'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt> </div></div><a name="L46"></a><tt class="py-lineno">46</tt> <tt class="py-line"> </tt><script type="text/javascript"> <!-- expandto(location.href); // --> </script> </pre> <br /> <!-- ==================== NAVIGATION BAR ==================== --> <table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> <tr valign="middle"> <!-- Tree link --> <th> <a href="module-tree.html">Trees</a> </th> <!-- Index link --> <th> <a href="identifier-index.html">Indices</a> </th> <!-- Help link --> <th> <a href="help.html">Help</a> </th> <th class="navbar" width="100%"></th> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="100%%"> <tr> <td align="left" class="footer"> Generated by Epydoc 3.0.1 on Wed Aug 11 21:33:26 2010 </td> <td align="right" class="footer"> <a target="mainFrame" href="http://epydoc.sourceforge.net" >http://epydoc.sourceforge.net</a> </td> </tr> </table> <script type="text/javascript"> <!-- // Private objects are initially displayed (because if // javascript is turned off then we want them to be // visible); but by default, we want to hide them. So hide // them unless we have a cookie that says to show them. checkCookie(); // --> </script> </body> </html>