1.1 --- a/gst-plugins-mythtv/AUTHORS Tue May 01 17:22:20 2007 +0100
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,4 +0,0 @@
1.4 -Alexsandro Jose Virginio dos Santos <alexsandro.santos@indt.org.br>
1.5 -Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
1.6 -Leonardo Sobral Cunha <leonardo.cunha@indt.org.br>
1.7 -Rosfran Lins Borges <rosfran.borges@indt.org.br>
2.1 --- a/gst-plugins-mythtv/COPYING Tue May 01 17:22:20 2007 +0100
2.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2.3 @@ -1,504 +0,0 @@
2.4 - GNU LESSER GENERAL PUBLIC LICENSE
2.5 - Version 2.1, February 1999
2.6 -
2.7 - Copyright (C) 1991, 1999 Free Software Foundation, Inc.
2.8 - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2.9 - Everyone is permitted to copy and distribute verbatim copies
2.10 - of this license document, but changing it is not allowed.
2.11 -
2.12 -[This is the first released version of the Lesser GPL. It also counts
2.13 - as the successor of the GNU Library Public License, version 2, hence
2.14 - the version number 2.1.]
2.15 -
2.16 - Preamble
2.17 -
2.18 - The licenses for most software are designed to take away your
2.19 -freedom to share and change it. By contrast, the GNU General Public
2.20 -Licenses are intended to guarantee your freedom to share and change
2.21 -free software--to make sure the software is free for all its users.
2.22 -
2.23 - This license, the Lesser General Public License, applies to some
2.24 -specially designated software packages--typically libraries--of the
2.25 -Free Software Foundation and other authors who decide to use it. You
2.26 -can use it too, but we suggest you first think carefully about whether
2.27 -this license or the ordinary General Public License is the better
2.28 -strategy to use in any particular case, based on the explanations below.
2.29 -
2.30 - When we speak of free software, we are referring to freedom of use,
2.31 -not price. Our General Public Licenses are designed to make sure that
2.32 -you have the freedom to distribute copies of free software (and charge
2.33 -for this service if you wish); that you receive source code or can get
2.34 -it if you want it; that you can change the software and use pieces of
2.35 -it in new free programs; and that you are informed that you can do
2.36 -these things.
2.37 -
2.38 - To protect your rights, we need to make restrictions that forbid
2.39 -distributors to deny you these rights or to ask you to surrender these
2.40 -rights. These restrictions translate to certain responsibilities for
2.41 -you if you distribute copies of the library or if you modify it.
2.42 -
2.43 - For example, if you distribute copies of the library, whether gratis
2.44 -or for a fee, you must give the recipients all the rights that we gave
2.45 -you. You must make sure that they, too, receive or can get the source
2.46 -code. If you link other code with the library, you must provide
2.47 -complete object files to the recipients, so that they can relink them
2.48 -with the library after making changes to the library and recompiling
2.49 -it. And you must show them these terms so they know their rights.
2.50 -
2.51 - We protect your rights with a two-step method: (1) we copyright the
2.52 -library, and (2) we offer you this license, which gives you legal
2.53 -permission to copy, distribute and/or modify the library.
2.54 -
2.55 - To protect each distributor, we want to make it very clear that
2.56 -there is no warranty for the free library. Also, if the library is
2.57 -modified by someone else and passed on, the recipients should know
2.58 -that what they have is not the original version, so that the original
2.59 -author's reputation will not be affected by problems that might be
2.60 -introduced by others.
2.61 -
2.62 - Finally, software patents pose a constant threat to the existence of
2.63 -any free program. We wish to make sure that a company cannot
2.64 -effectively restrict the users of a free program by obtaining a
2.65 -restrictive license from a patent holder. Therefore, we insist that
2.66 -any patent license obtained for a version of the library must be
2.67 -consistent with the full freedom of use specified in this license.
2.68 -
2.69 - Most GNU software, including some libraries, is covered by the
2.70 -ordinary GNU General Public License. This license, the GNU Lesser
2.71 -General Public License, applies to certain designated libraries, and
2.72 -is quite different from the ordinary General Public License. We use
2.73 -this license for certain libraries in order to permit linking those
2.74 -libraries into non-free programs.
2.75 -
2.76 - When a program is linked with a library, whether statically or using
2.77 -a shared library, the combination of the two is legally speaking a
2.78 -combined work, a derivative of the original library. The ordinary
2.79 -General Public License therefore permits such linking only if the
2.80 -entire combination fits its criteria of freedom. The Lesser General
2.81 -Public License permits more lax criteria for linking other code with
2.82 -the library.
2.83 -
2.84 - We call this license the "Lesser" General Public License because it
2.85 -does Less to protect the user's freedom than the ordinary General
2.86 -Public License. It also provides other free software developers Less
2.87 -of an advantage over competing non-free programs. These disadvantages
2.88 -are the reason we use the ordinary General Public License for many
2.89 -libraries. However, the Lesser license provides advantages in certain
2.90 -special circumstances.
2.91 -
2.92 - For example, on rare occasions, there may be a special need to
2.93 -encourage the widest possible use of a certain library, so that it becomes
2.94 -a de-facto standard. To achieve this, non-free programs must be
2.95 -allowed to use the library. A more frequent case is that a free
2.96 -library does the same job as widely used non-free libraries. In this
2.97 -case, there is little to gain by limiting the free library to free
2.98 -software only, so we use the Lesser General Public License.
2.99 -
2.100 - In other cases, permission to use a particular library in non-free
2.101 -programs enables a greater number of people to use a large body of
2.102 -free software. For example, permission to use the GNU C Library in
2.103 -non-free programs enables many more people to use the whole GNU
2.104 -operating system, as well as its variant, the GNU/Linux operating
2.105 -system.
2.106 -
2.107 - Although the Lesser General Public License is Less protective of the
2.108 -users' freedom, it does ensure that the user of a program that is
2.109 -linked with the Library has the freedom and the wherewithal to run
2.110 -that program using a modified version of the Library.
2.111 -
2.112 - The precise terms and conditions for copying, distribution and
2.113 -modification follow. Pay close attention to the difference between a
2.114 -"work based on the library" and a "work that uses the library". The
2.115 -former contains code derived from the library, whereas the latter must
2.116 -be combined with the library in order to run.
2.117 -
2.118 - GNU LESSER GENERAL PUBLIC LICENSE
2.119 - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
2.120 -
2.121 - 0. This License Agreement applies to any software library or other
2.122 -program which contains a notice placed by the copyright holder or
2.123 -other authorized party saying it may be distributed under the terms of
2.124 -this Lesser General Public License (also called "this License").
2.125 -Each licensee is addressed as "you".
2.126 -
2.127 - A "library" means a collection of software functions and/or data
2.128 -prepared so as to be conveniently linked with application programs
2.129 -(which use some of those functions and data) to form executables.
2.130 -
2.131 - The "Library", below, refers to any such software library or work
2.132 -which has been distributed under these terms. A "work based on the
2.133 -Library" means either the Library or any derivative work under
2.134 -copyright law: that is to say, a work containing the Library or a
2.135 -portion of it, either verbatim or with modifications and/or translated
2.136 -straightforwardly into another language. (Hereinafter, translation is
2.137 -included without limitation in the term "modification".)
2.138 -
2.139 - "Source code" for a work means the preferred form of the work for
2.140 -making modifications to it. For a library, complete source code means
2.141 -all the source code for all modules it contains, plus any associated
2.142 -interface definition files, plus the scripts used to control compilation
2.143 -and installation of the library.
2.144 -
2.145 - Activities other than copying, distribution and modification are not
2.146 -covered by this License; they are outside its scope. The act of
2.147 -running a program using the Library is not restricted, and output from
2.148 -such a program is covered only if its contents constitute a work based
2.149 -on the Library (independent of the use of the Library in a tool for
2.150 -writing it). Whether that is true depends on what the Library does
2.151 -and what the program that uses the Library does.
2.152 -
2.153 - 1. You may copy and distribute verbatim copies of the Library's
2.154 -complete source code as you receive it, in any medium, provided that
2.155 -you conspicuously and appropriately publish on each copy an
2.156 -appropriate copyright notice and disclaimer of warranty; keep intact
2.157 -all the notices that refer to this License and to the absence of any
2.158 -warranty; and distribute a copy of this License along with the
2.159 -Library.
2.160 -
2.161 - You may charge a fee for the physical act of transferring a copy,
2.162 -and you may at your option offer warranty protection in exchange for a
2.163 -fee.
2.164 -
2.165 - 2. You may modify your copy or copies of the Library or any portion
2.166 -of it, thus forming a work based on the Library, and copy and
2.167 -distribute such modifications or work under the terms of Section 1
2.168 -above, provided that you also meet all of these conditions:
2.169 -
2.170 - a) The modified work must itself be a software library.
2.171 -
2.172 - b) You must cause the files modified to carry prominent notices
2.173 - stating that you changed the files and the date of any change.
2.174 -
2.175 - c) You must cause the whole of the work to be licensed at no
2.176 - charge to all third parties under the terms of this License.
2.177 -
2.178 - d) If a facility in the modified Library refers to a function or a
2.179 - table of data to be supplied by an application program that uses
2.180 - the facility, other than as an argument passed when the facility
2.181 - is invoked, then you must make a good faith effort to ensure that,
2.182 - in the event an application does not supply such function or
2.183 - table, the facility still operates, and performs whatever part of
2.184 - its purpose remains meaningful.
2.185 -
2.186 - (For example, a function in a library to compute square roots has
2.187 - a purpose that is entirely well-defined independent of the
2.188 - application. Therefore, Subsection 2d requires that any
2.189 - application-supplied function or table used by this function must
2.190 - be optional: if the application does not supply it, the square
2.191 - root function must still compute square roots.)
2.192 -
2.193 -These requirements apply to the modified work as a whole. If
2.194 -identifiable sections of that work are not derived from the Library,
2.195 -and can be reasonably considered independent and separate works in
2.196 -themselves, then this License, and its terms, do not apply to those
2.197 -sections when you distribute them as separate works. But when you
2.198 -distribute the same sections as part of a whole which is a work based
2.199 -on the Library, the distribution of the whole must be on the terms of
2.200 -this License, whose permissions for other licensees extend to the
2.201 -entire whole, and thus to each and every part regardless of who wrote
2.202 -it.
2.203 -
2.204 -Thus, it is not the intent of this section to claim rights or contest
2.205 -your rights to work written entirely by you; rather, the intent is to
2.206 -exercise the right to control the distribution of derivative or
2.207 -collective works based on the Library.
2.208 -
2.209 -In addition, mere aggregation of another work not based on the Library
2.210 -with the Library (or with a work based on the Library) on a volume of
2.211 -a storage or distribution medium does not bring the other work under
2.212 -the scope of this License.
2.213 -
2.214 - 3. You may opt to apply the terms of the ordinary GNU General Public
2.215 -License instead of this License to a given copy of the Library. To do
2.216 -this, you must alter all the notices that refer to this License, so
2.217 -that they refer to the ordinary GNU General Public License, version 2,
2.218 -instead of to this License. (If a newer version than version 2 of the
2.219 -ordinary GNU General Public License has appeared, then you can specify
2.220 -that version instead if you wish.) Do not make any other change in
2.221 -these notices.
2.222 -
2.223 - Once this change is made in a given copy, it is irreversible for
2.224 -that copy, so the ordinary GNU General Public License applies to all
2.225 -subsequent copies and derivative works made from that copy.
2.226 -
2.227 - This option is useful when you wish to copy part of the code of
2.228 -the Library into a program that is not a library.
2.229 -
2.230 - 4. You may copy and distribute the Library (or a portion or
2.231 -derivative of it, under Section 2) in object code or executable form
2.232 -under the terms of Sections 1 and 2 above provided that you accompany
2.233 -it with the complete corresponding machine-readable source code, which
2.234 -must be distributed under the terms of Sections 1 and 2 above on a
2.235 -medium customarily used for software interchange.
2.236 -
2.237 - If distribution of object code is made by offering access to copy
2.238 -from a designated place, then offering equivalent access to copy the
2.239 -source code from the same place satisfies the requirement to
2.240 -distribute the source code, even though third parties are not
2.241 -compelled to copy the source along with the object code.
2.242 -
2.243 - 5. A program that contains no derivative of any portion of the
2.244 -Library, but is designed to work with the Library by being compiled or
2.245 -linked with it, is called a "work that uses the Library". Such a
2.246 -work, in isolation, is not a derivative work of the Library, and
2.247 -therefore falls outside the scope of this License.
2.248 -
2.249 - However, linking a "work that uses the Library" with the Library
2.250 -creates an executable that is a derivative of the Library (because it
2.251 -contains portions of the Library), rather than a "work that uses the
2.252 -library". The executable is therefore covered by this License.
2.253 -Section 6 states terms for distribution of such executables.
2.254 -
2.255 - When a "work that uses the Library" uses material from a header file
2.256 -that is part of the Library, the object code for the work may be a
2.257 -derivative work of the Library even though the source code is not.
2.258 -Whether this is true is especially significant if the work can be
2.259 -linked without the Library, or if the work is itself a library. The
2.260 -threshold for this to be true is not precisely defined by law.
2.261 -
2.262 - If such an object file uses only numerical parameters, data
2.263 -structure layouts and accessors, and small macros and small inline
2.264 -functions (ten lines or less in length), then the use of the object
2.265 -file is unrestricted, regardless of whether it is legally a derivative
2.266 -work. (Executables containing this object code plus portions of the
2.267 -Library will still fall under Section 6.)
2.268 -
2.269 - Otherwise, if the work is a derivative of the Library, you may
2.270 -distribute the object code for the work under the terms of Section 6.
2.271 -Any executables containing that work also fall under Section 6,
2.272 -whether or not they are linked directly with the Library itself.
2.273 -
2.274 - 6. As an exception to the Sections above, you may also combine or
2.275 -link a "work that uses the Library" with the Library to produce a
2.276 -work containing portions of the Library, and distribute that work
2.277 -under terms of your choice, provided that the terms permit
2.278 -modification of the work for the customer's own use and reverse
2.279 -engineering for debugging such modifications.
2.280 -
2.281 - You must give prominent notice with each copy of the work that the
2.282 -Library is used in it and that the Library and its use are covered by
2.283 -this License. You must supply a copy of this License. If the work
2.284 -during execution displays copyright notices, you must include the
2.285 -copyright notice for the Library among them, as well as a reference
2.286 -directing the user to the copy of this License. Also, you must do one
2.287 -of these things:
2.288 -
2.289 - a) Accompany the work with the complete corresponding
2.290 - machine-readable source code for the Library including whatever
2.291 - changes were used in the work (which must be distributed under
2.292 - Sections 1 and 2 above); and, if the work is an executable linked
2.293 - with the Library, with the complete machine-readable "work that
2.294 - uses the Library", as object code and/or source code, so that the
2.295 - user can modify the Library and then relink to produce a modified
2.296 - executable containing the modified Library. (It is understood
2.297 - that the user who changes the contents of definitions files in the
2.298 - Library will not necessarily be able to recompile the application
2.299 - to use the modified definitions.)
2.300 -
2.301 - b) Use a suitable shared library mechanism for linking with the
2.302 - Library. A suitable mechanism is one that (1) uses at run time a
2.303 - copy of the library already present on the user's computer system,
2.304 - rather than copying library functions into the executable, and (2)
2.305 - will operate properly with a modified version of the library, if
2.306 - the user installs one, as long as the modified version is
2.307 - interface-compatible with the version that the work was made with.
2.308 -
2.309 - c) Accompany the work with a written offer, valid for at
2.310 - least three years, to give the same user the materials
2.311 - specified in Subsection 6a, above, for a charge no more
2.312 - than the cost of performing this distribution.
2.313 -
2.314 - d) If distribution of the work is made by offering access to copy
2.315 - from a designated place, offer equivalent access to copy the above
2.316 - specified materials from the same place.
2.317 -
2.318 - e) Verify that the user has already received a copy of these
2.319 - materials or that you have already sent this user a copy.
2.320 -
2.321 - For an executable, the required form of the "work that uses the
2.322 -Library" must include any data and utility programs needed for
2.323 -reproducing the executable from it. However, as a special exception,
2.324 -the materials to be distributed need not include anything that is
2.325 -normally distributed (in either source or binary form) with the major
2.326 -components (compiler, kernel, and so on) of the operating system on
2.327 -which the executable runs, unless that component itself accompanies
2.328 -the executable.
2.329 -
2.330 - It may happen that this requirement contradicts the license
2.331 -restrictions of other proprietary libraries that do not normally
2.332 -accompany the operating system. Such a contradiction means you cannot
2.333 -use both them and the Library together in an executable that you
2.334 -distribute.
2.335 -
2.336 - 7. You may place library facilities that are a work based on the
2.337 -Library side-by-side in a single library together with other library
2.338 -facilities not covered by this License, and distribute such a combined
2.339 -library, provided that the separate distribution of the work based on
2.340 -the Library and of the other library facilities is otherwise
2.341 -permitted, and provided that you do these two things:
2.342 -
2.343 - a) Accompany the combined library with a copy of the same work
2.344 - based on the Library, uncombined with any other library
2.345 - facilities. This must be distributed under the terms of the
2.346 - Sections above.
2.347 -
2.348 - b) Give prominent notice with the combined library of the fact
2.349 - that part of it is a work based on the Library, and explaining
2.350 - where to find the accompanying uncombined form of the same work.
2.351 -
2.352 - 8. You may not copy, modify, sublicense, link with, or distribute
2.353 -the Library except as expressly provided under this License. Any
2.354 -attempt otherwise to copy, modify, sublicense, link with, or
2.355 -distribute the Library is void, and will automatically terminate your
2.356 -rights under this License. However, parties who have received copies,
2.357 -or rights, from you under this License will not have their licenses
2.358 -terminated so long as such parties remain in full compliance.
2.359 -
2.360 - 9. You are not required to accept this License, since you have not
2.361 -signed it. However, nothing else grants you permission to modify or
2.362 -distribute the Library or its derivative works. These actions are
2.363 -prohibited by law if you do not accept this License. Therefore, by
2.364 -modifying or distributing the Library (or any work based on the
2.365 -Library), you indicate your acceptance of this License to do so, and
2.366 -all its terms and conditions for copying, distributing or modifying
2.367 -the Library or works based on it.
2.368 -
2.369 - 10. Each time you redistribute the Library (or any work based on the
2.370 -Library), the recipient automatically receives a license from the
2.371 -original licensor to copy, distribute, link with or modify the Library
2.372 -subject to these terms and conditions. You may not impose any further
2.373 -restrictions on the recipients' exercise of the rights granted herein.
2.374 -You are not responsible for enforcing compliance by third parties with
2.375 -this License.
2.376 -
2.377 - 11. If, as a consequence of a court judgment or allegation of patent
2.378 -infringement or for any other reason (not limited to patent issues),
2.379 -conditions are imposed on you (whether by court order, agreement or
2.380 -otherwise) that contradict the conditions of this License, they do not
2.381 -excuse you from the conditions of this License. If you cannot
2.382 -distribute so as to satisfy simultaneously your obligations under this
2.383 -License and any other pertinent obligations, then as a consequence you
2.384 -may not distribute the Library at all. For example, if a patent
2.385 -license would not permit royalty-free redistribution of the Library by
2.386 -all those who receive copies directly or indirectly through you, then
2.387 -the only way you could satisfy both it and this License would be to
2.388 -refrain entirely from distribution of the Library.
2.389 -
2.390 -If any portion of this section is held invalid or unenforceable under any
2.391 -particular circumstance, the balance of the section is intended to apply,
2.392 -and the section as a whole is intended to apply in other circumstances.
2.393 -
2.394 -It is not the purpose of this section to induce you to infringe any
2.395 -patents or other property right claims or to contest validity of any
2.396 -such claims; this section has the sole purpose of protecting the
2.397 -integrity of the free software distribution system which is
2.398 -implemented by public license practices. Many people have made
2.399 -generous contributions to the wide range of software distributed
2.400 -through that system in reliance on consistent application of that
2.401 -system; it is up to the author/donor to decide if he or she is willing
2.402 -to distribute software through any other system and a licensee cannot
2.403 -impose that choice.
2.404 -
2.405 -This section is intended to make thoroughly clear what is believed to
2.406 -be a consequence of the rest of this License.
2.407 -
2.408 - 12. If the distribution and/or use of the Library is restricted in
2.409 -certain countries either by patents or by copyrighted interfaces, the
2.410 -original copyright holder who places the Library under this License may add
2.411 -an explicit geographical distribution limitation excluding those countries,
2.412 -so that distribution is permitted only in or among countries not thus
2.413 -excluded. In such case, this License incorporates the limitation as if
2.414 -written in the body of this License.
2.415 -
2.416 - 13. The Free Software Foundation may publish revised and/or new
2.417 -versions of the Lesser General Public License from time to time.
2.418 -Such new versions will be similar in spirit to the present version,
2.419 -but may differ in detail to address new problems or concerns.
2.420 -
2.421 -Each version is given a distinguishing version number. If the Library
2.422 -specifies a version number of this License which applies to it and
2.423 -"any later version", you have the option of following the terms and
2.424 -conditions either of that version or of any later version published by
2.425 -the Free Software Foundation. If the Library does not specify a
2.426 -license version number, you may choose any version ever published by
2.427 -the Free Software Foundation.
2.428 -
2.429 - 14. If you wish to incorporate parts of the Library into other free
2.430 -programs whose distribution conditions are incompatible with these,
2.431 -write to the author to ask for permission. For software which is
2.432 -copyrighted by the Free Software Foundation, write to the Free
2.433 -Software Foundation; we sometimes make exceptions for this. Our
2.434 -decision will be guided by the two goals of preserving the free status
2.435 -of all derivatives of our free software and of promoting the sharing
2.436 -and reuse of software generally.
2.437 -
2.438 - NO WARRANTY
2.439 -
2.440 - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
2.441 -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
2.442 -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
2.443 -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
2.444 -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
2.445 -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2.446 -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
2.447 -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
2.448 -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
2.449 -
2.450 - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
2.451 -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
2.452 -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
2.453 -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
2.454 -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
2.455 -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
2.456 -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
2.457 -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
2.458 -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
2.459 -DAMAGES.
2.460 -
2.461 - END OF TERMS AND CONDITIONS
2.462 -
2.463 - How to Apply These Terms to Your New Libraries
2.464 -
2.465 - If you develop a new library, and you want it to be of the greatest
2.466 -possible use to the public, we recommend making it free software that
2.467 -everyone can redistribute and change. You can do so by permitting
2.468 -redistribution under these terms (or, alternatively, under the terms of the
2.469 -ordinary General Public License).
2.470 -
2.471 - To apply these terms, attach the following notices to the library. It is
2.472 -safest to attach them to the start of each source file to most effectively
2.473 -convey the exclusion of warranty; and each file should have at least the
2.474 -"copyright" line and a pointer to where the full notice is found.
2.475 -
2.476 - <one line to give the library's name and a brief idea of what it does.>
2.477 - Copyright (C) <year> <name of author>
2.478 -
2.479 - This library is free software; you can redistribute it and/or
2.480 - modify it under the terms of the GNU Lesser General Public
2.481 - License as published by the Free Software Foundation; either
2.482 - version 2.1 of the License, or (at your option) any later version.
2.483 -
2.484 - This library is distributed in the hope that it will be useful,
2.485 - but WITHOUT ANY WARRANTY; without even the implied warranty of
2.486 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2.487 - Lesser General Public License for more details.
2.488 -
2.489 - You should have received a copy of the GNU Lesser General Public
2.490 - License along with this library; if not, write to the Free Software
2.491 - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2.492 -
2.493 -Also add information on how to contact you by electronic and paper mail.
2.494 -
2.495 -You should also get your employer (if you work as a programmer) or your
2.496 -school, if any, to sign a "copyright disclaimer" for the library, if
2.497 -necessary. Here is a sample; alter the names:
2.498 -
2.499 - Yoyodyne, Inc., hereby disclaims all copyright interest in the
2.500 - library `Frob' (a library for tweaking knobs) written by James Random Hacker.
2.501 -
2.502 - <signature of Ty Coon>, 1 April 1990
2.503 - Ty Coon, President of Vice
2.504 -
2.505 -That's all there is to it!
2.506 -
2.507 -
3.1 --- a/gst-plugins-mythtv/ChangeLog Tue May 01 17:22:20 2007 +0100
3.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
3.3 @@ -1,24 +0,0 @@
3.4 -2006-08-17 Rosfran Borges <rosfran.borges@indt.org.br>
3.5 - * Added the correct gstreamer-base package (GSTBASE) at the configure.ac;
3.6 - GSTBASE_CFLAGS and GSTBASE_LIBS variables had the same values from
3.7 - the GST_CFLAGS/GST_LIBS.
3.8 -
3.9 -2006-08-16 Rosfran Borges <rosfran.borges@indt.org.br>
3.10 - * Fixed some installation issues, regarding lib-installing to the
3.11 - correct directory, and copying the header files to the destination
3.12 - dir (make install).
3.13 - * Put 'pkg-config' resource to the Maemo Myth library. The name of the
3.14 - PKG-CONFIG resource is 'maemo-myth', plus the minor and major version.
3.15 - Actually, the version is '0.1', so the library config file is:
3.16 - 'maemo-myth-0.1.pc'. You can type: 'pkg-config --cflags --libs
3.17 - maemo-myth-0.1'.
3.18 - * Many adjustments in the automake/autoconf configuration files
3.19 - (configure.ac, Makefile.am) - some autotools misusage fixed.
3.20 - * Added the MythURI structure, and the URI parsing utility functions
3.21 - (missing in the GLib).
3.22 - * Some functions were exported (myth_socket, mmyth_context), that's
3.23 - why many ther modules need to use them.
3.24 - * Fixed some library dependencies.
3.25 - * Prepared to be used inside the GStreamer (linking with the MythTV
3.26 - plug-in).
3.27 -
4.1 --- a/gst-plugins-mythtv/INSTALL Tue May 01 17:22:20 2007 +0100
4.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
4.3 @@ -1,182 +0,0 @@
4.4 -Basic Installation
4.5 -==================
4.6 -
4.7 - These are generic installation instructions.
4.8 -
4.9 - The `configure' shell script attempts to guess correct values for
4.10 -various system-dependent variables used during compilation. It uses
4.11 -those values to create a `Makefile' in each directory of the package.
4.12 -It may also create one or more `.h' files containing system-dependent
4.13 -definitions. Finally, it creates a shell script `config.status' that
4.14 -you can run in the future to recreate the current configuration, a file
4.15 -`config.cache' that saves the results of its tests to speed up
4.16 -reconfiguring, and a file `config.log' containing compiler output
4.17 -(useful mainly for debugging `configure').
4.18 -
4.19 - If you need to do unusual things to compile the package, please try
4.20 -to figure out how `configure' could check whether to do them, and mail
4.21 -diffs or instructions to the address given in the `README' so they can
4.22 -be considered for the next release. If at some point `config.cache'
4.23 -contains results you don't want to keep, you may remove or edit it.
4.24 -
4.25 - The file `configure.in' is used to create `configure' by a program
4.26 -called `autoconf'. You only need `configure.in' if you want to change
4.27 -it or regenerate `configure' using a newer version of `autoconf'.
4.28 -
4.29 -The simplest way to compile this package is:
4.30 -
4.31 - 1. `cd' to the directory containing the package's source code and type
4.32 - `./configure' to configure the package for your system. If you're
4.33 - using `csh' on an old version of System V, you might need to type
4.34 - `sh ./configure' instead to prevent `csh' from trying to execute
4.35 - `configure' itself.
4.36 -
4.37 - Running `configure' takes awhile. While running, it prints some
4.38 - messages telling which features it is checking for.
4.39 -
4.40 - 2. Type `make' to compile the package.
4.41 -
4.42 - 3. Optionally, type `make check' to run any self-tests that come with
4.43 - the package.
4.44 -
4.45 - 4. Type `make install' to install the programs and any data files and
4.46 - documentation.
4.47 -
4.48 - 5. You can remove the program binaries and object files from the
4.49 - source code directory by typing `make clean'. To also remove the
4.50 - files that `configure' created (so you can compile the package for
4.51 - a different kind of computer), type `make distclean'. There is
4.52 - also a `make maintainer-clean' target, but that is intended mainly
4.53 - for the package's developers. If you use it, you may have to get
4.54 - all sorts of other programs in order to regenerate files that came
4.55 - with the distribution.
4.56 -
4.57 -Compilers and Options
4.58 -=====================
4.59 -
4.60 - Some systems require unusual options for compilation or linking that
4.61 -the `configure' script does not know about. You can give `configure'
4.62 -initial values for variables by setting them in the environment. Using
4.63 -a Bourne-compatible shell, you can do that on the command line like
4.64 -this:
4.65 - CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
4.66 -
4.67 -Or on systems that have the `env' program, you can do it like this:
4.68 - env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
4.69 -
4.70 -Compiling For Multiple Architectures
4.71 -====================================
4.72 -
4.73 - You can compile the package for more than one kind of computer at the
4.74 -same time, by placing the object files for each architecture in their
4.75 -own directory. To do this, you must use a version of `make' that
4.76 -supports the `VPATH' variable, such as GNU `make'. `cd' to the
4.77 -directory where you want the object files and executables to go and run
4.78 -the `configure' script. `configure' automatically checks for the
4.79 -source code in the directory that `configure' is in and in `..'.
4.80 -
4.81 - If you have to use a `make' that does not supports the `VPATH'
4.82 -variable, you have to compile the package for one architecture at a time
4.83 -in the source code directory. After you have installed the package for
4.84 -one architecture, use `make distclean' before reconfiguring for another
4.85 -architecture.
4.86 -
4.87 -Installation Names
4.88 -==================
4.89 -
4.90 - By default, `make install' will install the package's files in
4.91 -`/usr/local/bin', `/usr/local/man', etc. You can specify an
4.92 -installation prefix other than `/usr/local' by giving `configure' the
4.93 -option `--prefix=PATH'.
4.94 -
4.95 - You can specify separate installation prefixes for
4.96 -architecture-specific files and architecture-independent files. If you
4.97 -give `configure' the option `--exec-prefix=PATH', the package will use
4.98 -PATH as the prefix for installing programs and libraries.
4.99 -Documentation and other data files will still use the regular prefix.
4.100 -
4.101 - In addition, if you use an unusual directory layout you can give
4.102 -options like `--bindir=PATH' to specify different values for particular
4.103 -kinds of files. Run `configure --help' for a list of the directories
4.104 -you can set and what kinds of files go in them.
4.105 -
4.106 - If the package supports it, you can cause programs to be installed
4.107 -with an extra prefix or suffix on their names by giving `configure' the
4.108 -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
4.109 -
4.110 -Optional Features
4.111 -=================
4.112 -
4.113 - Some packages pay attention to `--enable-FEATURE' options to
4.114 -`configure', where FEATURE indicates an optional part of the package.
4.115 -They may also pay attention to `--with-PACKAGE' options, where PACKAGE
4.116 -is something like `gnu-as' or `x' (for the X Window System). The
4.117 -`README' should mention any `--enable-' and `--with-' options that the
4.118 -package recognizes.
4.119 -
4.120 - For packages that use the X Window System, `configure' can usually
4.121 -find the X include and library files automatically, but if it doesn't,
4.122 -you can use the `configure' options `--x-includes=DIR' and
4.123 -`--x-libraries=DIR' to specify their locations.
4.124 -
4.125 -Specifying the System Type
4.126 -==========================
4.127 -
4.128 - There may be some features `configure' can not figure out
4.129 -automatically, but needs to determine by the type of host the package
4.130 -will run on. Usually `configure' can figure that out, but if it prints
4.131 -a message saying it can not guess the host type, give it the
4.132 -`--host=TYPE' option. TYPE can either be a short name for the system
4.133 -type, such as `sun4', or a canonical name with three fields:
4.134 - CPU-COMPANY-SYSTEM
4.135 -
4.136 -See the file `config.sub' for the possible values of each field. If
4.137 -`config.sub' isn't included in this package, then this package doesn't
4.138 -need to know the host type.
4.139 -
4.140 - If you are building compiler tools for cross-compiling, you can also
4.141 -use the `--target=TYPE' option to select the type of system they will
4.142 -produce code for and the `--build=TYPE' option to select the type of
4.143 -system on which you are compiling the package.
4.144 -
4.145 -Sharing Defaults
4.146 -================
4.147 -
4.148 - If you want to set default values for `configure' scripts to share,
4.149 -you can create a site shell script called `config.site' that gives
4.150 -default values for variables like `CC', `cache_file', and `prefix'.
4.151 -`configure' looks for `PREFIX/share/config.site' if it exists, then
4.152 -`PREFIX/etc/config.site' if it exists. Or, you can set the
4.153 -`CONFIG_SITE' environment variable to the location of the site script.
4.154 -A warning: not all `configure' scripts look for a site script.
4.155 -
4.156 -Operation Controls
4.157 -==================
4.158 -
4.159 - `configure' recognizes the following options to control how it
4.160 -operates.
4.161 -
4.162 -`--cache-file=FILE'
4.163 - Use and save the results of the tests in FILE instead of
4.164 - `./config.cache'. Set FILE to `/dev/null' to disable caching, for
4.165 - debugging `configure'.
4.166 -
4.167 -`--help'
4.168 - Print a summary of the options to `configure', and exit.
4.169 -
4.170 -`--quiet'
4.171 -`--silent'
4.172 -`-q'
4.173 - Do not print messages saying which checks are being made. To
4.174 - suppress all normal output, redirect it to `/dev/null' (any error
4.175 - messages will still be shown).
4.176 -
4.177 -`--srcdir=DIR'
4.178 - Look for the package's source code in directory DIR. Usually
4.179 - `configure' can determine that directory automatically.
4.180 -
4.181 -`--version'
4.182 - Print the version of Autoconf used to generate the `configure'
4.183 - script, and exit.
4.184 -
4.185 -`configure' also accepts some other, not widely useful, options.
5.1 --- a/gst-plugins-mythtv/Makefile.am Tue May 01 17:22:20 2007 +0100
5.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
5.3 @@ -1,3 +0,0 @@
5.4 -SUBDIRS = src
5.5 -
5.6 -DIST_SUBDIRS = src
6.1 --- a/gst-plugins-mythtv/autogen.sh Tue May 01 17:22:20 2007 +0100
6.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
6.3 @@ -1,101 +0,0 @@
6.4 -#!/bin/sh
6.5 -# Run this to generate all the initial makefiles, etc.
6.6 -
6.7 -DIE=0
6.8 -package=mythtvsrc
6.9 -srcfile=configure.ac
6.10 -
6.11 -# a quick cvs co if necessary to alleviate the pain - may remove this
6.12 -# when developers get a clue ;)
6.13 -if test ! -d common;
6.14 -then
6.15 - echo "+ getting common/ from svn"
6.16 - svn co common
6.17 -fi
6.18 -
6.19 -# source helper functions
6.20 -if test ! -f common/autogen-helper.sh;
6.21 -then
6.22 - echo There is something wrong with your source tree.
6.23 - echo You are missing common/autogen-helper.sh
6.24 - exit 1
6.25 -fi
6.26 -. common/autogen-helper.sh
6.27 -
6.28 -CONFIGURE_DEF_OPT='--enable-maintainer-mode'
6.29 -
6.30 -CONFIGURE_EXT_OPT="$@"
6.31 -
6.32 -autogen_options
6.33 -
6.34 -echo -n "+ check for build tools"
6.35 -if test ! -z "$NOCHECK"; then echo " skipped"; else echo; fi
6.36 -version_check "autoconf" "$AUTOCONF autoconf autoconf-2.54 autoconf-2.53" \
6.37 - "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 53 || DIE=1
6.38 -version_check "automake" "$AUTOMAKE automake automake-1.9 automake-1.8 automake-1.7 automake-1.6" \
6.39 - "ftp://ftp.gnu.org/pub/gnu/automake/" 1 6 || DIE=1
6.40 -version_check "libtoolize" "$LIBTOOLIZE libtoolize" \
6.41 - "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 5 0 || DIE=1
6.42 -version_check "pkg-config" "" \
6.43 - "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
6.44 -
6.45 -die_check $DIE
6.46 -
6.47 -aclocal_check || DIE=1
6.48 -autoheader_check || DIE=1
6.49 -
6.50 -die_check $DIE
6.51 -
6.52 -# if no arguments specified then this will be printed
6.53 -if test -z "$*"; then
6.54 - echo "+ checking for autogen.sh options"
6.55 - echo " This autogen script will automatically run ./configure as:"
6.56 - echo " ./configure $CONFIGURE_DEF_OPT"
6.57 - echo " To pass any additional options, please specify them on the $0"
6.58 - echo " command line."
6.59 -fi
6.60 -
6.61 -toplevel_check $srcfile
6.62 -
6.63 -tool_run "$aclocal" "-I m4 $ACLOCAL_FLAGS"
6.64 -tool_run "$libtoolize" "--copy --force"
6.65 -tool_run "$autoheader"
6.66 -
6.67 -# touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode -- wingo
6.68 -echo timestamp > stamp-h.in 2> /dev/null
6.69 -
6.70 -tool_run "$autoconf"
6.71 -tool_run "$automake" "-a -c"
6.72 -
6.73 -# if enable exists, add an -enable option for each of the lines in that file
6.74 -if test -f enable; then
6.75 - for a in `cat enable`; do
6.76 - CONFIGURE_FILE_OPT="--enable-$a"
6.77 - done
6.78 -fi
6.79 -
6.80 -# if disable exists, add an -disable option for each of the lines in that file
6.81 -if test -f disable; then
6.82 - for a in `cat disable`; do
6.83 - CONFIGURE_FILE_OPT="$CONFIGURE_FILE_OPT --disable-$a"
6.84 - done
6.85 -fi
6.86 -
6.87 -test -n "$NOCONFIGURE" && {
6.88 - echo "+ skipping configure stage for package $package, as requested."
6.89 - echo "+ autogen.sh done."
6.90 - exit 0
6.91 -}
6.92 -
6.93 -echo "+ running configure ... "
6.94 -test ! -z "$CONFIGURE_DEF_OPT" && echo " ./configure default flags: $CONFIGURE_DEF_OPT"
6.95 -test ! -z "$CONFIGURE_EXT_OPT" && echo " ./configure external flags: $CONFIGURE_EXT_OPT"
6.96 -test ! -z "$CONFIGURE_FILE_OPT" && echo " ./configure enable/disable flags: $CONFIGURE_FILE_OPT"
6.97 -echo
6.98 -
6.99 -./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT $CONFIGURE_FILE_OPT || {
6.100 - echo " configure failed"
6.101 - exit 1
6.102 -}
6.103 -
6.104 -echo "Now type 'make' to compile $package."
7.1 --- a/gst-plugins-mythtv/common/Makefile.am Tue May 01 17:22:20 2007 +0100
7.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
7.3 @@ -1,1 +0,0 @@
7.4 -EXTRA_DIST = autogen-helper.sh
8.1 --- a/gst-plugins-mythtv/common/autogen-helper.sh Tue May 01 17:22:20 2007 +0100
8.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
8.3 @@ -1,302 +0,0 @@
8.4 -# a silly hack that generates autoregen.sh but it's handy
8.5 -echo "#!/bin/sh" > autoregen.sh
8.6 -echo "./autogen.sh $@ \$@" >> autoregen.sh
8.7 -chmod +x autoregen.sh
8.8 -
8.9 -# helper functions for autogen.sh
8.10 -
8.11 -debug ()
8.12 -# print out a debug message if DEBUG is a defined variable
8.13 -{
8.14 - if test ! -z "$DEBUG"
8.15 - then
8.16 - echo "DEBUG: $1"
8.17 - fi
8.18 -}
8.19 -
8.20 -version_check ()
8.21 -# check the version of a package
8.22 -# first argument : package name (executable)
8.23 -# second argument : optional path where to look for it instead
8.24 -# third argument : source download url
8.25 -# rest of arguments : major, minor, micro version
8.26 -# all consecutive ones : suggestions for binaries to use
8.27 -# (if not specified in second argument)
8.28 -{
8.29 - PACKAGE=$1
8.30 - PKG_PATH=$2
8.31 - URL=$3
8.32 - MAJOR=$4
8.33 - MINOR=$5
8.34 - MICRO=$6
8.35 -
8.36 - # for backwards compatibility, we let PKG_PATH=PACKAGE when PKG_PATH null
8.37 - if test -z "$PKG_PATH"; then PKG_PATH=$PACKAGE; fi
8.38 - debug "major $MAJOR minor $MINOR micro $MICRO"
8.39 - VERSION=$MAJOR
8.40 - if test ! -z "$MINOR"; then VERSION=$VERSION.$MINOR; else MINOR=0; fi
8.41 - if test ! -z "$MICRO"; then VERSION=$VERSION.$MICRO; else MICRO=0; fi
8.42 -
8.43 - debug "major $MAJOR minor $MINOR micro $MICRO"
8.44 -
8.45 - for SUGGESTION in $PKG_PATH; do
8.46 - COMMAND="$SUGGESTION"
8.47 -
8.48 - # don't check if asked not to
8.49 - test -z "$NOCHECK" && {
8.50 - echo -n " checking for $COMMAND >= $VERSION ... "
8.51 - } || {
8.52 - # we set a var with the same name as the package, but stripped of
8.53 - # unwanted chars
8.54 - VAR=`echo $PACKAGE | sed 's/-//g'`
8.55 - debug "setting $VAR"
8.56 - eval $VAR="$COMMAND"
8.57 - return 0
8.58 - }
8.59 -
8.60 - debug "checking version with $COMMAND"
8.61 - ($COMMAND --version) < /dev/null > /dev/null 2>&1 ||
8.62 - {
8.63 - echo "not found."
8.64 - continue
8.65 - }
8.66 - # strip everything that's not a digit, then use cut to get the first field
8.67 - pkg_version=`$COMMAND --version|head -n 1|sed 's/^[^0-9]*//'|cut -d' ' -f1`
8.68 - debug "pkg_version $pkg_version"
8.69 - # remove any non-digit characters from the version numbers to permit numeric
8.70 - # comparison
8.71 - pkg_major=`echo $pkg_version | cut -d. -f1 | sed s/[a-zA-Z\-].*//g`
8.72 - pkg_minor=`echo $pkg_version | cut -d. -f2 | sed s/[a-zA-Z\-].*//g`
8.73 - pkg_micro=`echo $pkg_version | cut -d. -f3 | sed s/[a-zA-Z\-].*//g`
8.74 - test -z "$pkg_major" && pkg_major=0
8.75 - test -z "$pkg_minor" && pkg_minor=0
8.76 - test -z "$pkg_micro" && pkg_micro=0
8.77 - debug "found major $pkg_major minor $pkg_minor micro $pkg_micro"
8.78 -
8.79 - #start checking the version
8.80 - debug "version check"
8.81 -
8.82 - # reset check
8.83 - WRONG=
8.84 -
8.85 - if [ ! "$pkg_major" -gt "$MAJOR" ]; then
8.86 - debug "major: $pkg_major <= $MAJOR"
8.87 - if [ "$pkg_major" -lt "$MAJOR" ]; then
8.88 - debug "major: $pkg_major < $MAJOR"
8.89 - WRONG=1
8.90 - elif [ ! "$pkg_minor" -gt "$MINOR" ]; then
8.91 - debug "minor: $pkg_minor <= $MINOR"
8.92 - if [ "$pkg_minor" -lt "$MINOR" ]; then
8.93 - debug "minor: $pkg_minor < $MINOR"
8.94 - WRONG=1
8.95 - elif [ "$pkg_micro" -lt "$MICRO" ]; then
8.96 - debug "micro: $pkg_micro < $MICRO"
8.97 - WRONG=1
8.98 - fi
8.99 - fi
8.100 - fi
8.101 -
8.102 - if test ! -z "$WRONG"; then
8.103 - echo "found $pkg_version, not ok !"
8.104 - continue
8.105 - else
8.106 - echo "found $pkg_version, ok."
8.107 - # we set a var with the same name as the package, but stripped of
8.108 - # unwanted chars
8.109 - VAR=`echo $PACKAGE | sed 's/-//g'`
8.110 - debug "setting $VAR"
8.111 - eval $VAR="$COMMAND"
8.112 - return 0
8.113 - fi
8.114 - done
8.115 -
8.116 - echo "not found !"
8.117 - echo "You must have $PACKAGE installed to compile $package."
8.118 - echo "Download the appropriate package for your distribution,"
8.119 - echo "or get the source tarball at $URL"
8.120 - return 1;
8.121 -}
8.122 -
8.123 -aclocal_check ()
8.124 -{
8.125 - # normally aclocal is part of automake
8.126 - # so we expect it to be in the same place as automake
8.127 - # so if a different automake is supplied, we need to adapt as well
8.128 - # so how's about replacing automake with aclocal in the set var,
8.129 - # and saving that in $aclocal ?
8.130 - # note, this will fail if the actual automake isn't called automake*
8.131 - # or if part of the path before it contains it
8.132 - if [ -z "$automake" ]; then
8.133 - echo "Error: no automake variable set !"
8.134 - return 1
8.135 - else
8.136 - aclocal=`echo $automake | sed s/automake/aclocal/`
8.137 - debug "aclocal: $aclocal"
8.138 - if [ "$aclocal" != "aclocal" ];
8.139 - then
8.140 - CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-aclocal=$aclocal"
8.141 - fi
8.142 - if [ ! -x `which $aclocal` ]; then
8.143 - echo "Error: cannot execute $aclocal !"
8.144 - return 1
8.145 - fi
8.146 - fi
8.147 -}
8.148 -
8.149 -autoheader_check ()
8.150 -{
8.151 - # same here - autoheader is part of autoconf
8.152 - # use the same voodoo
8.153 - if [ -z "$autoconf" ]; then
8.154 - echo "Error: no autoconf variable set !"
8.155 - return 1
8.156 - else
8.157 - autoheader=`echo $autoconf | sed s/autoconf/autoheader/`
8.158 - debug "autoheader: $autoheader"
8.159 - if [ "$autoheader" != "autoheader" ];
8.160 - then
8.161 - CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-autoheader=$autoheader"
8.162 - fi
8.163 - if [ ! -x `which $autoheader` ]; then
8.164 - echo "Error: cannot execute $autoheader !"
8.165 - return 1
8.166 - fi
8.167 - fi
8.168 -
8.169 -}
8.170 -
8.171 -autoconf_2_52d_check ()
8.172 -{
8.173 - # autoconf 2.52d has a weird issue involving a yes:no error
8.174 - # so don't allow it's use
8.175 - test -z "$NOCHECK" && {
8.176 - ac_version=`$autoconf --version|head -n 1|sed 's/^[a-zA-Z\.\ ()]*//;s/ .*$//'`
8.177 - if test "$ac_version" = "2.52d"; then
8.178 - echo "autoconf 2.52d has an issue with our current build."
8.179 - echo "We don't know who's to blame however. So until we do, get a"
8.180 - echo "regular version. RPM's of a working version are on the gstreamer site."
8.181 - exit 1
8.182 - fi
8.183 - }
8.184 - return 0
8.185 -}
8.186 -
8.187 -die_check ()
8.188 -{
8.189 - # call with $DIE
8.190 - # if set to 1, we need to print something helpful then die
8.191 - DIE=$1
8.192 - if test "x$DIE" = "x1";
8.193 - then
8.194 - echo
8.195 - echo "- Please get the right tools before proceeding."
8.196 - echo "- Alternatively, if you're sure we're wrong, run with --nocheck."
8.197 - exit 1
8.198 - fi
8.199 -}
8.200 -
8.201 -autogen_options ()
8.202 -{
8.203 - if test "x$1" = "x"; then
8.204 - return 0
8.205 - fi
8.206 -
8.207 - while test "x$1" != "x" ; do
8.208 - optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
8.209 - case "$1" in
8.210 - --noconfigure)
8.211 - NOCONFIGURE=defined
8.212 - AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --noconfigure"
8.213 - echo "+ configure run disabled"
8.214 - shift
8.215 - ;;
8.216 - --nocheck)
8.217 - AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --nocheck"
8.218 - NOCHECK=defined
8.219 - echo "+ autotools version check disabled"
8.220 - shift
8.221 - ;;
8.222 - --debug)
8.223 - DEBUG=defined
8.224 - AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --debug"
8.225 - echo "+ debug output enabled"
8.226 - shift
8.227 - ;;
8.228 - --prefix=*)
8.229 - CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT --prefix=$optarg"
8.230 - echo "+ passing --prefix=$optarg to configure"
8.231 - shift
8.232 - ;;
8.233 - --prefix)
8.234 - shift
8.235 - echo "DEBUG: $1"
8.236 - CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT --prefix=$1"
8.237 - echo "+ passing --prefix=$1 to configure"
8.238 - shift
8.239 - ;;
8.240 - -h|--help)
8.241 - echo "autogen.sh (autogen options) -- (configure options)"
8.242 - echo "autogen.sh help options: "
8.243 - echo " --noconfigure don't run the configure script"
8.244 - echo " --nocheck don't do version checks"
8.245 - echo " --debug debug the autogen process"
8.246 - echo " --prefix will be passed on to configure"
8.247 - echo
8.248 - echo " --with-autoconf PATH use autoconf in PATH"
8.249 - echo " --with-automake PATH use automake in PATH"
8.250 - echo
8.251 - echo "to pass options to configure, put them as arguments after -- "
8.252 - exit 1
8.253 - ;;
8.254 - --with-automake=*)
8.255 - AUTOMAKE=$optarg
8.256 - echo "+ using alternate automake in $optarg"
8.257 - CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-automake=$AUTOMAKE"
8.258 - shift
8.259 - ;;
8.260 - --with-autoconf=*)
8.261 - AUTOCONF=$optarg
8.262 - echo "+ using alternate autoconf in $optarg"
8.263 - CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-autoconf=$AUTOCONF"
8.264 - shift
8.265 - ;;
8.266 - --disable*|--enable*|--with*)
8.267 - echo "+ passing option $1 to configure"
8.268 - CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT $1"
8.269 - shift
8.270 - ;;
8.271 - --) shift ; break ;;
8.272 - *) echo "- ignoring unknown autogen.sh argument $1"; shift ;;
8.273 - esac
8.274 - done
8.275 -
8.276 - for arg do CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT $arg"; done
8.277 - if test ! -z "$CONFIGURE_EXT_OPT"
8.278 - then
8.279 - echo "+ options passed to configure: $CONFIGURE_EXT_OPT"
8.280 - fi
8.281 -}
8.282 -
8.283 -toplevel_check ()
8.284 -{
8.285 - srcfile=$1
8.286 - test -f $srcfile || {
8.287 - echo "You must run this script in the top-level $package directory"
8.288 - exit 1
8.289 - }
8.290 -}
8.291 -
8.292 -
8.293 -tool_run ()
8.294 -{
8.295 - tool=$1
8.296 - options=$2
8.297 - run_if_fail=$3
8.298 - echo "+ running $tool $options..."
8.299 - $tool $options || {
8.300 - echo
8.301 - echo $tool failed
8.302 - eval $run_if_fail
8.303 - exit 1
8.304 - }
8.305 -}
9.1 --- a/gst-plugins-mythtv/configure.ac Tue May 01 17:22:20 2007 +0100
9.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
9.3 @@ -1,172 +0,0 @@
9.4 -# -*- Autoconf -*-
9.5 -# Process this file with autoconf to produce a configure script.
9.6 -
9.7 -AC_PREREQ(2.50)
9.8 -
9.9 -AC_INIT([mythtvsrc],[0.1])
9.10 -
9.11 -dnl AC_CONFIG_SRCDIR([src])
9.12 -AC_CONFIG_HEADER(config.h)
9.13 -
9.14 -dnl when going to/from release please set the nano (fourth number) right !
9.15 -dnl releases only do Wall, SVN and prerelease does Werror too
9.16 -AS_VERSION(mythtvsrc, MYTHTVSRC, 0, 1, 0, 3, MYTHTVSRC_SVN="no", MYTHTVSRC_SVN="yes")
9.17 -
9.18 -MYTHTVSRC_MAJORMINOR=$MYTHTVSRC_MAJOR_VERSION.$MYTHTVSRC_MINOR_VERSION
9.19 -
9.20 -AC_SUBST(MYTHTVSRC_MAJORMINOR)
9.21 -
9.22 -dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode
9.23 -AM_MAINTAINER_MODE
9.24 -dnl make aclocal work in maintainer mode
9.25 -AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
9.26 -
9.27 -# Checks for programs.
9.28 -# check for tools
9.29 -# Make sure CFLAGS is defined to stop AC_PROC_CC adding -g
9.30 -CFLAGS="$CFLAGS -Wall"
9.31 -AC_PROG_CC
9.32 -AC_PROG_LIBTOOL
9.33 -# Checks for libraries.
9.34 -
9.35 -# Checks for header files.
9.36 -AC_HEADER_STDC
9.37 -AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h unistd.h])
9.38 -
9.39 -# Checks for typedefs, structures, and compiler characteristics.
9.40 -AC_C_CONST
9.41 -AC_TYPE_PID_T
9.42 -AC_STRUCT_TM
9.43 -
9.44 -# Checks for library functions.
9.45 -AC_FUNC_FORK
9.46 -AC_PROG_GCC_TRADITIONAL
9.47 -AC_FUNC_MALLOC
9.48 -AC_FUNC_MKTIME
9.49 -AC_FUNC_VPRINTF
9.50 -AC_CHECK_FUNCS([memset socket stime strstr strtoul])
9.51 -
9.52 -AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
9.53 -
9.54 -# Checks required packages
9.55 -
9.56 -dnl Test if --disable-debug given
9.57 -AC_ARG_ENABLE(debug,
9.58 - [AC_HELP_STRING([--disable-debug], [disable debugging mode])],
9.59 - enable_debug="$enableval",
9.60 - enable_debug=yes)
9.61 -
9.62 -if test "x$enable_debug" = "xyes" ; then
9.63 - CFLAGS="$CFLAGS -g"
9.64 -else
9.65 - AC_DEFINE( NDEBUG, 1, [disable debug messages] )
9.66 - CFLAGS="$CFLAGS -O2 -DG_DISABLE_CHECKS -DNDEBUG"
9.67 -fi
9.68 -
9.69 -AM_CONDITIONAL( NDEBUG, test "x$enable_debug" = "xyes" )
9.70 -
9.71 -# Check for pkgconfig
9.72 -AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
9.73 -# Give error and exit if we don't have pkgconfig
9.74 -if test "x$HAVE_PKGCONFIG" = "xno"; then
9.75 - AC_MSG_ERROR(you need to have pkgconfig installed !)
9.76 -fi
9.77 -
9.78 -# Check for Glib2.0
9.79 -PKG_CHECK_MODULES(GLIB, glib-2.0, HAVE_GLIB=yes,HAVE_GLIB=no)
9.80 -
9.81 -# Give error and exit if we don't have glib
9.82 -if test "x$HAVE_GLIB" = "xno"; then
9.83 - AC_MSG_ERROR(you need glib-2.0 installed)
9.84 -fi
9.85 -
9.86 -# make GLIB_CFLAGS and GLIB_LIBS available
9.87 -AC_SUBST(GLIB_CFLAGS)
9.88 -AC_SUBST(GLIB_LIBS)
9.89 -
9.90 -# Check for GObject2.0
9.91 -PKG_CHECK_MODULES(GOBJECT,
9.92 - gobject-2.0,
9.93 - HAVE_GOBJECT=yes, HAVE_GOBJECT=no)
9.94 -
9.95 -# Give error and exit if we don't have gobject
9.96 -if test "x$HAVE_GOBJECT" = "xno"; then
9.97 - AC_MSG_ERROR(you need gobject-2.0 installed)
9.98 -fi
9.99 -
9.100 -# make GOBJECT_CFLAGS and GOBJECT_LIBS available
9.101 -AC_SUBST(GOBJECT_CFLAGS)
9.102 -AC_SUBST(GOBJECT_LIBS)
9.103 -
9.104 -dnl *** MythTV ***
9.105 -PKG_CHECK_MODULES(GMYTH,
9.106 - gmyth,
9.107 - HAVE_GMYTH=yes, HAVE_GMYTH=no)
9.108 -
9.109 -# Give error and exit if we don't have gobject
9.110 -if test "x$HAVE_GMYTH" = "xno"; then
9.111 - AC_MSG_ERROR(you need gmyth must to be installed)
9.112 -fi
9.113 -
9.114 -# make GMYTH_CFLAGS and GMYTH_LIBS available
9.115 -AC_SUBST(GMYTH_CFLAGS)
9.116 -AC_SUBST(GMYTH_LIBS)
9.117 -
9.118 -# GStreamer version required
9.119 -GST_REQUIRED=0.10
9.120 -GST_MAJORMINOR=0.10
9.121 -
9.122 -GST_PLUGINS_DIR=`$PKG_CONFIG gstreamer-plugins-base-$GST_MAJORMINOR --variable pluginsdir`
9.123 -AC_SUBST(GST_PLUGINS_DIR)
9.124 -AC_MSG_NOTICE(Using GStreamer Base Plugins in $GST_PLUGINS_DIR)
9.125 -
9.126 -dnl this really should only contain flags, not libs - they get added before
9.127 -dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
9.128 -GST_PLUGIN_LDFLAGS="-module -avoid-version $GST_PLUGINS_DIR"
9.129 -AC_SUBST(GST_PLUGIN_LDFLAGS)
9.130 -
9.131 -# check for gstreamer development files
9.132 -PKG_CHECK_MODULES(GST, \
9.133 - gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED,
9.134 - HAVE_GST=yes, HAVE_GST=no)
9.135 -
9.136 -# Give error and exit if we don't have gstreamer
9.137 -if test "x$HAVE_GST" = "xno"; then
9.138 - AC_MSG_ERROR(you need gstreamer development packages installed !)
9.139 -fi
9.140 -
9.141 -# make GST_CFLAGS and GST_LIBS available
9.142 -AC_SUBST(GST_CFLAGS)
9.143 -AC_SUBST(GST_LIBS)
9.144 -
9.145 -# check for gstreamer-base plugins (xoverlay interface)
9.146 -GST_BASE_REQUIRED=0.10
9.147 -GST_BASE_MAJORMINOR=0.10
9.148 -PKG_CHECK_MODULES(GST_BASE, \
9.149 - gstreamer-base-$GST_BASE_MAJORMINOR >= $GST_BASE_REQUIRED,
9.150 - HAVE_GST_BASE=yes, HAVE_GST_BASE=no)
9.151 -
9.152 -# Give error and exit if we don't have gstreamer base libraries
9.153 -if test "x$HAVE_GST_BASE" = "xno"; then
9.154 - AC_MSG_ERROR(you need gstreamer base development packages installed !)
9.155 -fi
9.156 -
9.157 -# make GST_BASE_CFLAGS and GST_BASE_LIBS available
9.158 -AC_SUBST(GST_BASE_CFLAGS)
9.159 -AC_SUBST(GST_BASE_LIBS)
9.160 -
9.161 -# make GST_MAJORMINOR available in Makefile.am
9.162 -AC_SUBST(GST_MAJORMINOR)
9.163 -
9.164 -AC_DEFINE(GST_LICENSE, "LGPL", [License for Distribution])
9.165 -
9.166 -AC_DEFINE(GST_PACKAGE_NAME, "GStreamer", [Gstremar package name])
9.167 -
9.168 -AC_DEFINE(GST_PACKAGE_ORIGIN, "http://gstreamer.net/", [Origin of this package] )
9.169 -
9.170 -AC_CONFIG_FILES([
9.171 -Makefile
9.172 -src/Makefile
9.173 -])
9.174 -
9.175 -AC_OUTPUT
10.1 --- a/gst-plugins-mythtv/debian/changelog Tue May 01 17:22:20 2007 +0100
10.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
10.3 @@ -1,5 +0,0 @@
10.4 -gst-indt-mythsrc (0.10.2.debian-1) unstable; urgency=low
10.5 -
10.6 - * Initial package
10.7 -
10.8 - -- Renato Araujo Filho <renato.filho@indt.org.br> Thu, 12 Apr 2007 11:58:08 -0300
11.1 --- a/gst-plugins-mythtv/debian/compat Tue May 01 17:22:20 2007 +0100
11.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
11.3 @@ -1,1 +0,0 @@
11.4 -4
12.1 --- a/gst-plugins-mythtv/debian/control Tue May 01 17:22:20 2007 +0100
12.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
12.3 @@ -1,12 +0,0 @@
12.4 -Source: gst-indt-mythsrc
12.5 -Section: libs
12.6 -Priority: optional
12.7 -Maintainer: Renato Araujo Filho <renato.filho@indt.org.br>
12.8 -Build-Depends: debhelper (>= 4.1.0), cdbs (>= 0.4.8), autotools-dev, pkg-config (>= 0.11.0), libgstreamer0.10-dev (>= 0.10.0), gmyth-dev (>= 0.3)
12.9 -Standards-Version: 3.6.2
12.10 -
12.11 -Package: gstreamer0.10-indt-mythsrc
12.12 -Architecture: any
12.13 -Section: libs
12.14 -Depends: gmyth (>= 0.3)
12.15 -Description: INdT mythtv source GStreamer plugin
13.1 --- a/gst-plugins-mythtv/debian/copyright Tue May 01 17:22:20 2007 +0100
13.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
13.3 @@ -1,23 +0,0 @@
13.4 -This package was debianized by Renato Araujo Oliveira Filho <renato.filho@indt.org.br> on
13.5 -Thu, 09 Nov 2006 15:58:00 -0300.
13.6 -
13.7 -Copyright Holder: 2006 INdT
13.8 -
13.9 -License:
13.10 -
13.11 - This package is free software; you can redistribute it and/or modify
13.12 - it under the terms of the GNU General Public License as published by
13.13 - the Free Software Foundation; version 2 dated June, 1991.
13.14 -
13.15 - This package is distributed in the hope that it will be useful,
13.16 - but WITHOUT ANY WARRANTY; without even the implied warranty of
13.17 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13.18 - GNU General Public License for more details.
13.19 -
13.20 - You should have received a copy of the GNU General Public License
13.21 - along with this package; if not, write to the Free Software
13.22 - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
13.23 - MA 02110-1301, USA.
13.24 -
13.25 -On Debian systems, the complete text of the GNU General
13.26 -Public License can be found in `/usr/share/common-licenses/GPL'.
14.1 --- a/gst-plugins-mythtv/debian/gstreamer0.10-indt-mythsrc.install Tue May 01 17:22:20 2007 +0100
14.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
14.3 @@ -1,1 +0,0 @@
14.4 -debian/tmp/usr/lib/gstreamer-*/*.so
15.1 --- a/gst-plugins-mythtv/debian/rules Tue May 01 17:22:20 2007 +0100
15.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
15.3 @@ -1,11 +0,0 @@
15.4 -#!/usr/bin/make -f
15.5 -
15.6 -include /usr/share/cdbs/1/rules/debhelper.mk
15.7 -include /usr/share/cdbs/1/rules/simple-patchsys.mk
15.8 -include /usr/share/cdbs/1/class/gnome.mk
15.9 -include /usr/share/cdbs/1/rules/utils.mk
15.10 -
15.11 -binary-install/gstreamer0.10-indt-mythsrc::
15.12 - rm -f debian/gstreamer0.10-indt-mythsrc/usr/lib/gstreamer-0.10/libgst*.la
15.13 - rm -f debian/gstreamer0.10-indt-mythsrc/usr/lib/gstreamer-0.10/libgst*.a
15.14 -
16.1 --- a/gst-plugins-mythtv/list_nuvs.txt Tue May 01 17:22:20 2007 +0100
16.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
16.3 @@ -1,12 +0,0 @@
16.4 --rw-r--r-- 1 root root 18571375 2006-08-01 11:13 1000_20060801111003.nuv
16.5 --rw-r--r-- 1 root root 54497771 2006-08-01 11:35 1000_20060801112503.nuv
16.6 --rw-rw-rw- 1 root root 13014 2006-08-01 11:35 1000_20060801112503.nuv.png
16.7 --rw-r--r-- 1 root root 9426451 2006-08-10 19:00 1000_20060810185736.nuv
16.8 --rw-rw-rw- 1 root root 1994 2006-08-10 19:00 1000_20060810185736.nuv.png
16.9 --rw-r--r-- 1 root root 117860332 2006-08-10 19:30 1000_20060810190003.nuv
16.10 --rw-r--r-- 1 root root 21139175 2006-08-17 15:15 1000_20060817151003.nuv
16.11 --rw-rw-rw- 1 root root 8703 2006-08-17 15:15 1000_20060817151003.nuv.png
16.12 -
16.13 -
16.14 -hallyson's perfomance:
16.15 -mplayer 1000_20060801112503.nuv
17.1 --- a/gst-plugins-mythtv/m4/Makefile.am Tue May 01 17:22:20 2007 +0100
17.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
17.3 @@ -1,7 +0,0 @@
17.4 -EXTRA_DIST = \
17.5 - ac_doxygen.m4 \
17.6 - as-compiler-flag.m4 \
17.7 - as-expand.m4 \
17.8 - as-version.m4 \
17.9 - as-gtk-doc.m4
17.10 -
18.1 --- a/gst-plugins-mythtv/m4/ac_doxygen.m4 Tue May 01 17:22:20 2007 +0100
18.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
18.3 @@ -1,312 +0,0 @@
18.4 -# This file is part of Autoconf. -*- Autoconf -*-
18.5 -
18.6 -# Copyright (C) 2004 Oren Ben-Kiki
18.7 -# This file is distributed under the same terms as the Autoconf macro files.
18.8 -
18.9 -# Generate automatic documentation using Doxygen. Works in concert with the
18.10 -# aminclude.m4 file and a compatible doxygen configuration file. Defines the
18.11 -# following public macros:
18.12 -#
18.13 -# DX_???_FEATURE(ON|OFF) - control the default setting fo a Doxygen feature.
18.14 -# Supported features are 'DOXYGEN' itself, 'DOT' for generating graphics,
18.15 -# 'HTML' for plain HTML, 'CHM' for compressed HTML help (for MS users), 'CHI'
18.16 -# for generating a seperate .chi file by the .chm file, and 'MAN', 'RTF',
18.17 -# 'XML', 'PDF' and 'PS' for the appropriate output formats. The environment
18.18 -# variable DOXYGEN_PAPER_SIZE may be specified to override the default 'a4wide'
18.19 -# paper size.
18.20 -#
18.21 -# By default, HTML, PDF and PS documentation is generated as this seems to be
18.22 -# the most popular and portable combination. MAN pages created by Doxygen are
18.23 -# usually problematic, though by picking an appropriate subset and doing some
18.24 -# massaging they might be better than nothing. CHM and RTF are specific for MS
18.25 -# (note that you can't generate both HTML and CHM at the same time). The XML is
18.26 -# rather useless unless you apply specialized post-processing to it.
18.27 -#
18.28 -# The macro mainly controls the default state of the feature. The use can
18.29 -# override the default by specifying --enable or --disable. The macros ensure
18.30 -# that contradictory flags are not given (e.g., --enable-doxygen-html and
18.31 -# --enable-doxygen-chm, --enable-doxygen-anything with --disable-doxygen, etc.)
18.32 -# Finally, each feature will be automatically disabled (with a warning) if the
18.33 -# required programs are missing.
18.34 -#
18.35 -# Once all the feature defaults have been specified, call DX_INIT_DOXYGEN with
18.36 -# the following parameters: a one-word name for the project for use as a
18.37 -# filename base etc., an optional configuration file name (the default is
18.38 -# 'Doxyfile', the same as Doxygen's default), and an optional output directory
18.39 -# name (the default is 'doxygen-doc').
18.40 -
18.41 -## ----------##
18.42 -## Defaults. ##
18.43 -## ----------##
18.44 -
18.45 -DX_ENV=""
18.46 -AC_DEFUN([DX_FEATURE_doc], ON)
18.47 -AC_DEFUN([DX_FEATURE_dot], ON)
18.48 -AC_DEFUN([DX_FEATURE_man], OFF)
18.49 -AC_DEFUN([DX_FEATURE_html], ON)
18.50 -AC_DEFUN([DX_FEATURE_chm], OFF)
18.51 -AC_DEFUN([DX_FEATURE_chi], OFF)
18.52 -AC_DEFUN([DX_FEATURE_rtf], OFF)
18.53 -AC_DEFUN([DX_FEATURE_xml], OFF)
18.54 -AC_DEFUN([DX_FEATURE_pdf], ON)
18.55 -AC_DEFUN([DX_FEATURE_ps], ON)
18.56 -
18.57 -## --------------- ##
18.58 -## Private macros. ##
18.59 -## --------------- ##
18.60 -
18.61 -# DX_ENV_APPEND(VARIABLE, VALUE)
18.62 -# ------------------------------
18.63 -# Append VARIABLE="VALUE" to DX_ENV for invoking doxygen.
18.64 -AC_DEFUN([DX_ENV_APPEND], [AC_SUBST([DX_ENV], ["$DX_ENV $1='$2'"])])
18.65 -
18.66 -# DX_DIRNAME_EXPR
18.67 -# ---------------
18.68 -# Expand into a shell expression prints the directory part of a path.
18.69 -AC_DEFUN([DX_DIRNAME_EXPR],
18.70 - [[expr ".$1" : '\(\.\)[^/]*$' \| "x$1" : 'x\(.*\)/[^/]*$']])
18.71 -
18.72 -# DX_IF_FEATURE(FEATURE, IF-ON, IF-OFF)
18.73 -# -------------------------------------
18.74 -# Expands according to the M4 (static) status of the feature.
18.75 -AC_DEFUN([DX_IF_FEATURE], [ifelse(DX_FEATURE_$1, ON, [$2], [$3])])
18.76 -
18.77 -# DX_REQUIRE_PROG(VARIABLE, PROGRAM)
18.78 -# ----------------------------------
18.79 -# Require the specified program to be found for the DX_CURRENT_FEATURE to work.
18.80 -AC_DEFUN([DX_REQUIRE_PROG], [
18.81 -AC_PATH_TOOL([$1], [$2])
18.82 -if test "$DX_FLAG_[]DX_CURRENT_FEATURE$$1" = 1; then
18.83 - AC_MSG_WARN([$2 not found - will not DX_CURRENT_DESCRIPTION])
18.84 - AC_SUBST([DX_FLAG_[]DX_CURRENT_FEATURE], 0)
18.85 -fi
18.86 -])
18.87 -
18.88 -# DX_TEST_FEATURE(FEATURE)
18.89 -# ------------------------
18.90 -# Expand to a shell expression testing whether the feature is active.
18.91 -AC_DEFUN([DX_TEST_FEATURE], [test "$DX_FLAG_$1" = 1])
18.92 -
18.93 -# DX_CHECK_DEPEND(REQUIRED_FEATURE, REQUIRED_STATE)
18.94 -# -------------------------------------------------
18.95 -# Verify that a required features has the right state before trying to turn on
18.96 -# the DX_CURRENT_FEATURE.
18.97 -AC_DEFUN([DX_CHECK_DEPEND], [
18.98 -test "$DX_FLAG_$1" = "$2" \
18.99 -|| AC_MSG_ERROR([doxygen-DX_CURRENT_FEATURE ifelse([$2], 1,
18.100 - requires, contradicts) doxygen-DX_CURRENT_FEATURE])
18.101 -])
18.102 -
18.103 -# DX_CLEAR_DEPEND(FEATURE, REQUIRED_FEATURE, REQUIRED_STATE)
18.104 -# ----------------------------------------------------------
18.105 -# Turn off the DX_CURRENT_FEATURE if the required feature is off.
18.106 -AC_DEFUN([DX_CLEAR_DEPEND], [
18.107 -test "$DX_FLAG_$1" = "$2" || AC_SUBST([DX_FLAG_[]DX_CURRENT_FEATURE], 0)
18.108 -])
18.109 -
18.110 -# DX_FEATURE_ARG(FEATURE, DESCRIPTION,
18.111 -# CHECK_DEPEND, CLEAR_DEPEND,
18.112 -# REQUIRE, DO-IF-ON, DO-IF-OFF)
18.113 -# --------------------------------------------
18.114 -# Parse the command-line option controlling a feature. CHECK_DEPEND is called
18.115 -# if the user explicitly turns the feature on (and invokes DX_CHECK_DEPEND),
18.116 -# otherwise CLEAR_DEPEND is called to turn off the default state if a required
18.117 -# feature is disabled (using DX_CLEAR_DEPEND). REQUIRE performs additional
18.118 -# requirement tests (DX_REQUIRE_PROG). Finally, an automake flag is set and
18.119 -# DO-IF-ON or DO-IF-OFF are called according to the final state of the feature.
18.120 -AC_DEFUN([DX_ARG_ABLE], [
18.121 - AC_DEFUN([DX_CURRENT_FEATURE], [$1])
18.122 - AC_DEFUN([DX_CURRENT_DESCRIPTION], [$2])
18.123 - AC_ARG_ENABLE(doxygen-$1,
18.124 - [AS_HELP_STRING(DX_IF_FEATURE([$1], [--disable-doxygen-$1],
18.125 - [--enable-doxygen-$1]),
18.126 - DX_IF_FEATURE([$1], [don't $2], [$2]))],
18.127 - [
18.128 -case "$enableval" in
18.129 -#(
18.130 -y|Y|yes|Yes|YES)
18.131 - AC_SUBST([DX_FLAG_$1], 1)
18.132 - $3
18.133 -;; #(
18.134 -n|N|no|No|NO)
18.135 - AC_SUBST([DX_FLAG_$1], 0)
18.136 -;; #(
18.137 -*)
18.138 - AC_MSG_ERROR([invalid value '$enableval' given to doxygen-$1])
18.139 -;;
18.140 -esac
18.141 -], [
18.142 -AC_SUBST([DX_FLAG_$1], [DX_IF_FEATURE([$1], 1, 0)])
18.143 -$4
18.144 -])
18.145 -if DX_TEST_FEATURE([$1]); then
18.146 - $5
18.147 - :
18.148 -fi
18.149 -if DX_TEST_FEATURE([$1]); then
18.150 - AM_CONDITIONAL(DX_COND_$1, :)
18.151 - $6
18.152 - :
18.153 -else
18.154 - AM_CONDITIONAL(DX_COND_$1, false)
18.155 - $7
18.156 - :
18.157 -fi
18.158 -])
18.159 -
18.160 -## -------------- ##
18.161 -## Public macros. ##
18.162 -## -------------- ##
18.163 -
18.164 -# DX_XXX_FEATURE(DEFAULT_STATE)
18.165 -# -----------------------------
18.166 -AC_DEFUN([DX_DOXYGEN_FEATURE], [AC_DEFUN([DX_FEATURE_doc], [$1])])
18.167 -AC_DEFUN([DX_MAN_FEATURE], [AC_DEFUN([DX_FEATURE_man], [$1])])
18.168 -AC_DEFUN([DX_HTML_FEATURE], [AC_DEFUN([DX_FEATURE_html], [$1])])
18.169 -AC_DEFUN([DX_CHM_FEATURE], [AC_DEFUN([DX_FEATURE_chm], [$1])])
18.170 -AC_DEFUN([DX_CHI_FEATURE], [AC_DEFUN([DX_FEATURE_chi], [$1])])
18.171 -AC_DEFUN([DX_RTF_FEATURE], [AC_DEFUN([DX_FEATURE_rtf], [$1])])
18.172 -AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])])
18.173 -AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])])
18.174 -AC_DEFUN([DX_PDF_FEATURE], [AC_DEFUN([DX_FEATURE_pdf], [$1])])
18.175 -AC_DEFUN([DX_PS_FEATURE], [AC_DEFUN([DX_FEATURE_ps], [$1])])
18.176 -
18.177 -# DX_INIT_DOXYGEN(PROJECT, [CONFIG-FILE], [OUTPUT-DOC-DIR])
18.178 -# ---------------------------------------------------------
18.179 -# PROJECT also serves as the base name for the documentation files.
18.180 -# The default CONFIG-FILE is "Doxyfile" and OUTPUT-DOC-DIR is "doxygen-doc".
18.181 -AC_DEFUN([DX_INIT_DOXYGEN], [
18.182 -
18.183 -# Files:
18.184 -AC_SUBST([DX_PROJECT], [$1])
18.185 -AC_SUBST([DX_CONFIG], [ifelse([$2], [], Doxyfile, [$2])])
18.186 -AC_SUBST([DX_DOCDIR], [ifelse([$3], [], doxygen-doc, [$3])])
18.187 -
18.188 -# Environment variables used inside doxygen.cfg:
18.189 -DX_ENV_APPEND(SRCDIR, $srcdir)
18.190 -DX_ENV_APPEND(PROJECT, $DX_PROJECT)
18.191 -DX_ENV_APPEND(DOCDIR, $DX_DOCDIR)
18.192 -DX_ENV_APPEND(VERSION, $PACKAGE_VERSION)
18.193 -
18.194 -# Doxygen itself:
18.195 -DX_ARG_ABLE(doc, [generate any doxygen documentation],
18.196 - [],
18.197 - [],
18.198 - [DX_REQUIRE_PROG([DX_DOXYGEN], doxygen)
18.199 - DX_REQUIRE_PROG([DX_PERL], perl)],
18.200 - [DX_ENV_APPEND(PERL_PATH, $DX_PERL)])
18.201 -
18.202 -# Dot for graphics:
18.203 -DX_ARG_ABLE(dot, [generate graphics for doxygen documentation],
18.204 - [DX_CHECK_DEPEND(doc, 1)],
18.205 - [DX_CLEAR_DEPEND(doc, 1)],
18.206 - [DX_REQUIRE_PROG([DX_DOT], dot)],
18.207 - [DX_ENV_APPEND(HAVE_DOT, YES)
18.208 - DX_ENV_APPEND(DOT_PATH, [`DX_DIRNAME_EXPR($DX_DOT)`])],
18.209 - [DX_ENV_APPEND(HAVE_DOT, NO)])
18.210 -
18.211 -# Man pages generation:
18.212 -DX_ARG_ABLE(man, [generate doxygen manual pages],
18.213 - [DX_CHECK_DEPEND(doc, 1)],
18.214 - [DX_CLEAR_DEPEND(doc, 1)],
18.215 - [],
18.216 - [DX_ENV_APPEND(GENERATE_MAN, YES)],
18.217 - [DX_ENV_APPEND(GENERATE_MAN, NO)])
18.218 -
18.219 -# RTF file generation:
18.220 -DX_ARG_ABLE(rtf, [generate doxygen RTF documentation],
18.221 - [DX_CHECK_DEPEND(doc, 1)],
18.222 - [DX_CLEAR_DEPEND(doc, 1)],
18.223 - [],
18.224 - [DX_ENV_APPEND(GENERATE_RTF, YES)],
18.225 - [DX_ENV_APPEND(GENERATE_RTF, NO)])
18.226 -
18.227 -# XML file generation:
18.228 -DX_ARG_ABLE(xml, [generate doxygen XML documentation],
18.229 - [DX_CHECK_DEPEND(doc, 1)],
18.230 - [DX_CLEAR_DEPEND(doc, 1)],
18.231 - [],
18.232 - [DX_ENV_APPEND(GENERATE_XML, YES)],
18.233 - [DX_ENV_APPEND(GENERATE_XML, NO)])
18.234 -
18.235 -# (Compressed) HTML help generation:
18.236 -DX_ARG_ABLE(chm, [generate doxygen compressed HTML help documentation],
18.237 - [DX_CHECK_DEPEND(doc, 1)],
18.238 - [DX_CLEAR_DEPEND(doc, 1)],
18.239 - [DX_REQUIRE_PROG([DX_HHC], hhc)],
18.240 - [DX_ENV_APPEND(HHC_PATH, $DX_HHC)
18.241 - DX_ENV_APPEND(GENERATE_HTML, YES)
18.242 - DX_ENV_APPEND(GENERATE_HTMLHELP, YES)],
18.243 - [DX_ENV_APPEND(GENERATE_HTMLHELP, NO)])
18.244 -
18.245 -# Seperate CHI file generation.
18.246 -DX_ARG_ABLE(chi, [generate doxygen seperate compressed HTML help index file],
18.247 - [DX_CHECK_DEPEND(chm, 1)],
18.248 - [DX_CLEAR_DEPEND(chm, 1)],
18.249 - [],
18.250 - [DX_ENV_APPEND(GENERATE_CHI, YES)],
18.251 - [DX_ENV_APPEND(GENERATE_CHI, NO)])
18.252 -
18.253 -# Plain HTML pages generation:
18.254 -DX_ARG_ABLE(html, [generate doxygen plain HTML documentation],
18.255 - [DX_CHECK_DEPEND(doc, 1) DX_CHECK_DEPEND(chm, 0)],
18.256 - [DX_CLEAR_DEPEND(doc, 1) DX_CLEAR_DEPEND(chm, 0)],
18.257 - [],
18.258 - [DX_ENV_APPEND(GENERATE_HTML, YES)],
18.259 - [DX_TEST_FEATURE(chm) || DX_ENV_APPEND(GENERATE_HTML, NO)])
18.260 -
18.261 -# PostScript file generation:
18.262 -DX_ARG_ABLE(ps, [generate doxygen PostScript documentation],
18.263 - [DX_CHECK_DEPEND(doc, 1)],
18.264 - [DX_CLEAR_DEPEND(doc, 1)],
18.265 - [DX_REQUIRE_PROG([DX_LATEX], latex)
18.266 - DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex)
18.267 - DX_REQUIRE_PROG([DX_DVIPS], dvips)
18.268 - DX_REQUIRE_PROG([DX_EGREP], egrep)])
18.269 -
18.270 -# PDF file generation:
18.271 -DX_ARG_ABLE(pdf, [generate doxygen PDF documentation],
18.272 - [DX_CHECK_DEPEND(doc, 1)],
18.273 - [DX_CLEAR_DEPEND(doc, 1)],
18.274 - [DX_REQUIRE_PROG([DX_PDFLATEX], pdflatex)
18.275 - DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex)
18.276 - DX_REQUIRE_PROG([DX_EGREP], egrep)])
18.277 -
18.278 -# LaTeX generation for PS and/or PDF:
18.279 -if DX_TEST_FEATURE(ps) || DX_TEST_FEATURE(pdf); then
18.280 - AM_CONDITIONAL(DX_COND_latex, :)
18.281 - DX_ENV_APPEND(GENERATE_LATEX, YES)
18.282 -else
18.283 - AM_CONDITIONAL(DX_COND_latex, false)
18.284 - DX_ENV_APPEND(GENERATE_LATEX, NO)
18.285 -fi
18.286 -
18.287 -# Paper size for PS and/or PDF:
18.288 -AC_ARG_VAR(DOXYGEN_PAPER_SIZE,
18.289 - [a4wide (default), a4, letter, legal or executive])
18.290 -case "$DOXYGEN_PAPER_SIZE" in
18.291 -#(
18.292 -"")
18.293 - AC_SUBST(DOXYGEN_PAPER_SIZE, "")
18.294 -;; #(
18.295 -a4wide|a4|letter|legal|executive)
18.296 - DX_ENV_APPEND(PAPER_SIZE, $DOXYGEN_PAPER_SIZE)
18.297 -;; #(
18.298 -*)
18.299 - AC_MSG_ERROR([unknown DOXYGEN_PAPER_SIZE='$DOXYGEN_PAPER_SIZE'])
18.300 -;;
18.301 -esac
18.302 -
18.303 -#For debugging:
18.304 -#echo DX_FLAG_doc=$DX_FLAG_doc
18.305 -#echo DX_FLAG_dot=$DX_FLAG_dot
18.306 -#echo DX_FLAG_man=$DX_FLAG_man
18.307 -#echo DX_FLAG_html=$DX_FLAG_html
18.308 -#echo DX_FLAG_chm=$DX_FLAG_chm
18.309 -#echo DX_FLAG_chi=$DX_FLAG_chi
18.310 -#echo DX_FLAG_rtf=$DX_FLAG_rtf
18.311 -#echo DX_FLAG_xml=$DX_FLAG_xml
18.312 -#echo DX_FLAG_pdf=$DX_FLAG_pdf
18.313 -#echo DX_FLAG_ps=$DX_FLAG_ps
18.314 -#echo DX_ENV=$DX_ENV
18.315 -])
19.1 --- a/gst-plugins-mythtv/m4/as-compiler-flag.m4 Tue May 01 17:22:20 2007 +0100
19.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
19.3 @@ -1,33 +0,0 @@
19.4 -dnl as-compiler-flag.m4 0.1.0
19.5 -
19.6 -dnl autostars m4 macro for detection of compiler flags
19.7 -
19.8 -dnl David Schleef <ds@schleef.org>
19.9 -
19.10 -dnl $Id: as-compiler-flag.m4,v 1.1.1.1 2005/08/26 00:42:44 andrunko Exp $
19.11 -
19.12 -dnl AS_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED])
19.13 -dnl Tries to compile with the given CFLAGS.
19.14 -dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags,
19.15 -dnl and ACTION-IF-NOT-ACCEPTED otherwise.
19.16 -
19.17 -AC_DEFUN([AS_COMPILER_FLAG],
19.18 -[
19.19 - AC_MSG_CHECKING([to see if compiler understands $1])
19.20 -
19.21 - save_CFLAGS="$CFLAGS"
19.22 - CFLAGS="$CFLAGS $1"
19.23 -
19.24 - AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no])
19.25 - CFLAGS="$save_CFLAGS"
19.26 -
19.27 - if test "X$flag_ok" = Xyes ; then
19.28 - $2
19.29 - true
19.30 - else
19.31 - $3
19.32 - true
19.33 - fi
19.34 - AC_MSG_RESULT([$flag_ok])
19.35 -])
19.36 -
20.1 --- a/gst-plugins-mythtv/m4/as-expand.m4 Tue May 01 17:22:20 2007 +0100
20.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
20.3 @@ -1,40 +0,0 @@
20.4 -dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
20.5 -dnl
20.6 -dnl example
20.7 -dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
20.8 -dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
20.9 -
20.10 -AC_DEFUN([AS_AC_EXPAND],
20.11 -[
20.12 - EXP_VAR=[$1]
20.13 - FROM_VAR=[$2]
20.14 -
20.15 - dnl first expand prefix and exec_prefix if necessary
20.16 - prefix_save=$prefix
20.17 - exec_prefix_save=$exec_prefix
20.18 -
20.19 - dnl if no prefix given, then use /usr/local, the default prefix
20.20 - if test "x$prefix" = "xNONE"; then
20.21 - prefix=$ac_default_prefix
20.22 - fi
20.23 - dnl if no exec_prefix given, then use prefix
20.24 - if test "x$exec_prefix" = "xNONE"; then
20.25 - exec_prefix=$prefix
20.26 - fi
20.27 -
20.28 - full_var="$FROM_VAR"
20.29 - dnl loop until it doesn't change anymore
20.30 - while true; do
20.31 - new_full_var="`eval echo $full_var`"
20.32 - if test "x$new_full_var"="x$full_var"; then break; fi
20.33 - full_var=$new_full_var
20.34 - done
20.35 -
20.36 - dnl clean up
20.37 - full_var=$new_full_var
20.38 - AC_SUBST([$1], "$full_var")
20.39 -
20.40 - dnl restore prefix and exec_prefix
20.41 - prefix=$prefix_save
20.42 - exec_prefix=$exec_prefix_save
20.43 -])
21.1 --- a/gst-plugins-mythtv/m4/as-version.m4 Tue May 01 17:22:20 2007 +0100
21.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
21.3 @@ -1,59 +0,0 @@
21.4 -dnl version.m4 0.0.5
21.5 -dnl autostars m4 macro for versioning
21.6 -dnl thomas@apestaart.org
21.7 -dnl
21.8 -dnl AS_VERSION(PACKAGE, PREFIX, MAJOR, MINOR, MICRO, NANO, ACTION_IF_NO_NANO, ACTION_IF_NANO)
21.9 -dnl example
21.10 -dnl AS_VERSION(gstreamer, GST_VERSION, 0, 3, 2,)
21.11 -dnl for a 0.3.2 release version
21.12 -dnl
21.13 -dnl this macro
21.14 -dnl - defines [$PREFIX]_MAJOR, MINOR and MICRO
21.15 -dnl - if NANO is empty, then we're in release mode, else in cvs/dev mode
21.16 -dnl - defines [$PREFIX], VERSION, and [$PREFIX]_RELEASE
21.17 -dnl - executes the relevant action
21.18 -dnl - AC_SUBST's PACKAGE, VERSION, [$PREFIX] and [$PREFIX]_RELEASE
21.19 -dnl as well as the little ones
21.20 -dnl - doesn't call AM_INIT_AUTOMAKE anymore because it prevents
21.21 -dnl maintainer mode from running ok
21.22 -dnl
21.23 -dnl don't forget to put #undef [$2] and [$2]_RELEASE in acconfig.h
21.24 -
21.25 -AC_DEFUN([AS_VERSION],
21.26 -[
21.27 - PACKAGE=[$1]
21.28 - [$2]_MAJOR_VERSION=[$3]
21.29 - [$2]_MINOR_VERSION=[$4]
21.30 - [$2]_MICRO_VERSION=[$5]
21.31 - NANO=[$6]
21.32 - [$2]_NANO_VERSION=$NANO
21.33 - if test "x$NANO" = "x" || test "x$NANO" = "x0";
21.34 - then
21.35 - AC_MSG_NOTICE(configuring [$1] for release)
21.36 - VERSION=[$3].[$4].[$5]
21.37 - [$2]_RELEASE=1
21.38 - dnl execute action
21.39 - ifelse([$7], , :, [$7])
21.40 - else
21.41 - AC_MSG_NOTICE(configuring [$1] for development with nano $NANO)
21.42 - VERSION=[$3].[$4].[$5].$NANO
21.43 - [$2]_RELEASE=`date +%Y%m%d_%H%M%S`
21.44 - dnl execute action
21.45 - ifelse([$8], , :, [$8])
21.46 - fi
21.47 -
21.48 - [$2]_VERSION=$VERSION
21.49 - AC_DEFINE_UNQUOTED([$2]_VERSION, "$[$2]_VERSION", [Define the version])
21.50 - AC_SUBST([$2]_VERSION)
21.51 -
21.52 - AC_SUBST([$2]_RELEASE)
21.53 -
21.54 - AC_SUBST([$2]_MAJOR_VERSION)
21.55 - AC_SUBST([$2]_MINOR_VERSION)
21.56 - AC_SUBST([$2]_MICRO_VERSION)
21.57 - AC_SUBST([$2]_NANO_VERSION)
21.58 - AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define the package name])
21.59 - AC_SUBST(PACKAGE)
21.60 - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Define the version])
21.61 - AC_SUBST(VERSION)
21.62 -])
22.1 --- a/gst-plugins-mythtv/src/Makefile.am Tue May 01 17:22:20 2007 +0100
22.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
22.3 @@ -1,23 +0,0 @@
22.4 -plugindir = $(libdir)/gstreamer-@GST_MAJORMINOR@
22.5 -
22.6 -plugin_LTLIBRARIES = libgstmythtvsrc.la
22.7 -
22.8 -libgstmythtvsrc_la_SOURCES = \
22.9 - gstmythtvsrc.c
22.10 -
22.11 -libgstmythtvsrc_la_CFLAGS = \
22.12 - $(GST_CFLAGS) \
22.13 - $(GST_BASE_CFLAGS) \
22.14 - $(GMYTH_CFLAGS)
22.15 -
22.16 -libgstmythtvsrc_la_LDFLAGS = \
22.17 - $(GST_PLUGIN_LDFLAGS)
22.18 -
22.19 -libgstmythtvsrc_la_LIBADD = \
22.20 - $(GST_LIBS) \
22.21 - $(GST_BASE_LIBS) \
22.22 - $(GMYTH_LIBS)
22.23 -
22.24 -noinst_HEADERS = \
22.25 - gstmythtvsrc.h
22.26 -
23.1 --- a/gst-plugins-mythtv/src/gstmythtvsrc.c Tue May 01 17:22:20 2007 +0100
23.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
23.3 @@ -1,1259 +0,0 @@
23.4 -/* GStreamer MythTV Plug-in
23.5 - * Copyright (C) <2006> Rosfran Borges <rosfran.borges@indt.org.br>
23.6 - *
23.7 - * This library is free software; you can redistribute it and/or
23.8 - * modify it under the terms of the GNU Library General Public
23.9 - * License as published by the Free Software Foundation; either
23.10 - * version 2 of the License, or (at your option) any later version.
23.11 - *
23.12 - * This library is distributed in the hope that it will be useful,
23.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
23.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23.15 - * Library General Public License for more details.
23.16 - *
23.17 - * You should have received a copy of the GNU Library General Public
23.18 - * License along with this library; if not, write to the
23.19 - * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23.20 - * Boston, MA 02111-1307, USA.
23.21 - */
23.22 -/**
23.23 - * SECTION:element-mythtvsrc
23.24 - *
23.25 - * <refsect2>
23.26 - * <para>
23.27 - * MythTVSrc allows to access a remote MythTV backend streaming Video/Audio server,
23.28 - * and to render audio and video content through a TCP/IP connection to a specific
23.29 - * port on this server, and based on a known MythTV protocol that is based on
23.30 - * some message passing, such as REQUEST_BLOCK on a specified number of bytes, to get
23.31 - * some chunk of remote file data.
23.32 - * You should pass the information aboute the remote MythTV backend server
23.33 - * through the <link linkend="GstMythTVSrc--location">location</link> property.
23.34 - * </para>
23.35 - * <title>Examples</title>
23.36 - * <para>
23.37 - * If you want to get the LiveTV content (set channel, TV tuner, RemoteEncoder,
23.38 - * Recorder),
23.39 - * put the following URI:
23.40 - *
23.41 - * <programlisting>
23.42 - * myth://xxx.xxx.xxx.xxx:6543/livetv?channel=BBC
23.43 - * </programlisting>
23.44 - *
23.45 - * This URI will say to the gmyth library to configure the Recorder instance (used to
23.46 - * change the channel, start the TV multimedia content transmition, etc.), using
23.47 - * the IP address (xxx.xxx.xxx.xxx) and port number (6543) of the MythTV backend
23.48 - * server, and setting the channel name to "BBC".
23.49 - *
23.50 - * To get a already recorded the MythTV NUV file, put the following URI:
23.51 - *
23.52 - * <programlisting>
23.53 - * myth://xxx.xxx.xxx.xxx:6543/filename.nuv
23.54 - * </programlisting>
23.55 - *
23.56 - * This URI will say to the gmyth library to configure the Recorder instance (used to
23.57 - * change the channel, start the TV multimedia content transmition, etc.), using
23.58 - * the IP address (xxx.xxx.xxx.xxx) and port number (6543) of the MythTV backend
23.59 - * server, and setting the channel name to "BBC".
23.60 - *
23.61 - * Another possible way to use the LiveTV content, and just in the case you want to
23.62 - * use the mysql database, put the location URI in the following format:
23.63 - *
23.64 - * <programlisting>
23.65 - * myth://mythtv:mythtv@xxx.xxx.xxx.xxx:6543/?mythconverg&channel=9
23.66 - * </programlisting>
23.67 - *
23.68 - * Where the first field is the protocol (myth), the second and third are user
23.69 - * name (mythtv) and password (mythtv), then backend host name and port number,
23.70 - * and the last field is the database name (mythconverg).
23.71 - * </para>
23.72 - * </refsect2>
23.73 - */
23.74 -#ifdef HAVE_CONFIG_H
23.75 -#include "config.h"
23.76 -#endif
23.77 -
23.78 -#include "gstmythtvsrc.h"
23.79 -#include <gmyth/gmyth_file.h>
23.80 -#include <gmyth/gmyth_file_transfer.h>
23.81 -#include <gmyth/gmyth_file_local.h>
23.82 -#include <gmyth/gmyth_livetv.h>
23.83 -
23.84 -#include <gmyth/gmyth_socket.h>
23.85 -#include <gmyth/gmyth_tvchain.h>
23.86 -
23.87 -#include <string.h>
23.88 -#include <unistd.h>
23.89 -
23.90 -GST_DEBUG_CATEGORY_STATIC (mythtvsrc_debug);
23.91 -#define GST_CAT_DEFAULT mythtvsrc_debug
23.92 -
23.93 -#define GST_GMYTHTV_ID_NUM 1
23.94 -
23.95 -#define GST_GMYTHTV_CHANNEL_DEFAULT_NUM (-1)
23.96 -
23.97 -#define GMYTHTV_VERSION_DEFAULT 30
23.98 -
23.99 -#define GMYTHTV_TRANSFER_MAX_WAITS 100
23.100 -
23.101 -#define GMYTHTV_TRANSFER_MAX_RESENDS 2
23.102 -
23.103 -#define GMYTHTV_TRANSFER_MAX_BUFFER (128*1024)
23.104 -
23.105 -#define MAX_READ_SIZE (4*1024)
23.106 -
23.107 -#define GST_FLOW_ERROR_NO_DATA (-101)
23.108 -
23.109 -#define REQUEST_MAX_SIZE (64*1024)
23.110 -
23.111 -#define INTERNAL_BUFFER_SIZE (90*1024)
23.112 -
23.113 -static const GstElementDetails gst_mythtv_src_details =
23.114 -GST_ELEMENT_DETAILS ("MythTV client source",
23.115 - "Source/Network",
23.116 - "Control and receive data as a client over the network "
23.117 - "via raw socket connections using the MythTV protocol",
23.118 - "Rosfran Borges <rosfran.borges@indt.org.br>");
23.119 -
23.120 -static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
23.121 - GST_PAD_SRC,
23.122 - GST_PAD_ALWAYS,
23.123 - GST_STATIC_CAPS ("video/x-nuv"));
23.124 -
23.125 -enum
23.126 -{
23.127 - PROP_0,
23.128 - PROP_LOCATION,
23.129 -#ifndef GST_DISABLE_GST_DEBUG
23.130 - PROP_GMYTHTV_DBG,
23.131 -#endif
23.132 - PROP_GMYTHTV_VERSION,
23.133 - PROP_GMYTHTV_LIVE,
23.134 - PROP_GMYTHTV_LIVEID,
23.135 - PROP_GMYTHTV_LIVE_CHAINID,
23.136 - PROP_GMYTHTV_ENABLE_TIMING_POSITION,
23.137 - PROP_GMYTHTV_CHANNEL_NUM,
23.138 - PROP_GMYTHTV_MAX_TRY
23.139 -};
23.140 -
23.141 -static void gst_mythtv_src_clear (GstMythtvSrc *mythtv_src);
23.142 -
23.143 -static void gst_mythtv_src_finalize (GObject * gobject);
23.144 -
23.145 -static GstFlowReturn gst_mythtv_src_create (GstPushSrc * psrc,
23.146 - GstBuffer ** outbuf);
23.147 -
23.148 -static gboolean gst_mythtv_src_start (GstBaseSrc * bsrc);
23.149 -static gboolean gst_mythtv_src_stop (GstBaseSrc * bsrc);
23.150 -static gboolean gst_mythtv_src_get_size (GstBaseSrc * bsrc, guint64 * size);
23.151 -static gboolean gst_mythtv_src_is_seekable (GstBaseSrc * push_src);
23.152 -
23.153 -static gboolean gst_mythtv_src_do_seek (GstBaseSrc * base,
23.154 - GstSegment * segment);
23.155 -
23.156 -static GstStateChangeReturn
23.157 -gst_mythtv_src_change_state (GstElement * element, GstStateChange transition);
23.158 -
23.159 -static void gst_mythtv_src_set_property (GObject * object, guint prop_id,
23.160 - const GValue * value, GParamSpec * pspec);
23.161 -static void gst_mythtv_src_get_property (GObject * object, guint prop_id,
23.162 - GValue * value, GParamSpec * pspec);
23.163 -
23.164 -static void gst_mythtv_src_uri_handler_init (gpointer g_iface,
23.165 - gpointer iface_data);
23.166 -
23.167 -static gboolean gst_mythtv_src_handle_query (GstPad * pad, GstQuery * query);
23.168 -
23.169 -static gboolean gst_mythtv_src_handle_event (GstPad * pad, GstEvent * event);
23.170 -
23.171 -static GMythFileReadResult do_read_request_response (GstMythtvSrc * src, guint size,
23.172 - GByteArray * data_ptr);
23.173 -
23.174 -static void
23.175 -_urihandler_init (GType type)
23.176 -{
23.177 - static const GInterfaceInfo urihandler_info = {
23.178 - gst_mythtv_src_uri_handler_init,
23.179 - NULL,
23.180 - NULL
23.181 - };
23.182 -
23.183 - g_type_add_interface_static (type, GST_TYPE_URI_HANDLER, &urihandler_info);
23.184 -
23.185 - GST_DEBUG_CATEGORY_INIT (mythtvsrc_debug, "mythtvsrc", 0, "MythTV src");
23.186 -}
23.187 -
23.188 -GST_BOILERPLATE_FULL (GstMythtvSrc, gst_mythtv_src, GstPushSrc,
23.189 - GST_TYPE_PUSH_SRC, _urihandler_init)
23.190 -
23.191 - static void gst_mythtv_src_base_init (gpointer g_class)
23.192 -{
23.193 - GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
23.194 -
23.195 - gst_element_class_add_pad_template (element_class,
23.196 - gst_static_pad_template_get (&srctemplate));
23.197 -
23.198 - gst_element_class_set_details (element_class, &gst_mythtv_src_details);
23.199 -
23.200 - element_class->change_state = gst_mythtv_src_change_state;
23.201 -
23.202 -}
23.203 -
23.204 -static void
23.205 -gst_mythtv_src_class_init (GstMythtvSrcClass * klass)
23.206 -{
23.207 - GObjectClass *gobject_class;
23.208 - GstPushSrcClass *gstpushsrc_class;
23.209 - GstBaseSrcClass *gstbasesrc_class;
23.210 -
23.211 - gobject_class = (GObjectClass *) klass;
23.212 - gstbasesrc_class = (GstBaseSrcClass *) klass;
23.213 - gstpushsrc_class = (GstPushSrcClass *) klass;
23.214 -
23.215 - gobject_class->set_property = gst_mythtv_src_set_property;
23.216 - gobject_class->get_property = gst_mythtv_src_get_property;
23.217 - gobject_class->finalize = gst_mythtv_src_finalize;
23.218 -
23.219 - g_object_class_install_property
23.220 - (gobject_class, PROP_LOCATION,
23.221 - g_param_spec_string ("location", "Location",
23.222 - "The location. In the form:"
23.223 - "\n\t\t\tmyth://a.com/file.nuv"
23.224 - "\n\t\t\tmyth://a.com:23223/file.nuv "
23.225 - "\n\t\t\ta.com/file.nuv - default scheme 'myth'",
23.226 - "", G_PARAM_READWRITE));
23.227 -
23.228 - g_object_class_install_property
23.229 - (gobject_class, PROP_GMYTHTV_VERSION,
23.230 - g_param_spec_int ("mythtv-version", "mythtv-version",
23.231 - "Change MythTV version", 26, 30, 26, G_PARAM_READWRITE));
23.232 -
23.233 - g_object_class_install_property
23.234 - (gobject_class, PROP_GMYTHTV_LIVEID,
23.235 - g_param_spec_int ("mythtv-live-id", "mythtv-live-id",
23.236 - "Change MythTV version",
23.237 - 0, 200, GST_GMYTHTV_ID_NUM, G_PARAM_READWRITE));
23.238 -
23.239 - g_object_class_install_property
23.240 - (gobject_class, PROP_GMYTHTV_LIVE_CHAINID,
23.241 - g_param_spec_string ("mythtv-live-chainid", "mythtv-live-chainid",
23.242 - "Sets the MythTV chain ID (from TV Chain)", "", G_PARAM_READWRITE));
23.243 -
23.244 - g_object_class_install_property
23.245 - (gobject_class, PROP_GMYTHTV_LIVE,
23.246 - g_param_spec_boolean ("mythtv-live", "mythtv-live",
23.247 - "Enable MythTV Live TV content streaming", FALSE, G_PARAM_READWRITE));
23.248 -
23.249 - g_object_class_install_property
23.250 - (gobject_class, PROP_GMYTHTV_ENABLE_TIMING_POSITION,
23.251 - g_param_spec_boolean ("mythtv-enable-timing-position",
23.252 - "mythtv-enable-timing-position",
23.253 - "Enable MythTV Live TV content size continuous updating", FALSE,
23.254 - G_PARAM_READWRITE));
23.255 -
23.256 - g_object_class_install_property
23.257 - (gobject_class, PROP_GMYTHTV_CHANNEL_NUM,
23.258 - g_param_spec_string ("mythtv-channel", "mythtv-channel",
23.259 - "Change MythTV channel number",
23.260 - "", G_PARAM_READWRITE));
23.261 -
23.262 - g_object_class_install_property
23.263 - (gobject_class, PROP_GMYTHTV_MAX_TRY,
23.264 - g_param_spec_int ("max-try", "max-try",
23.265 - "Set the max try for get MythTV free recorder",
23.266 - 0, G_MAXINT, 10, G_PARAM_READWRITE));
23.267 -
23.268 -
23.269 -#ifndef GST_DISABLE_GST_DEBUG
23.270 - g_object_class_install_property
23.271 - (gobject_class, PROP_GMYTHTV_DBG,
23.272 - g_param_spec_boolean ("mythtv-debug", "mythtv-debug",
23.273 - "Enable MythTV debug messages", FALSE, G_PARAM_READWRITE));
23.274 -#endif
23.275 -
23.276 - gstbasesrc_class->start = gst_mythtv_src_start;
23.277 - gstbasesrc_class->stop = gst_mythtv_src_stop;
23.278 - gstbasesrc_class->get_size = gst_mythtv_src_get_size;
23.279 - gstbasesrc_class->is_seekable = gst_mythtv_src_is_seekable;
23.280 -
23.281 - gstbasesrc_class->do_seek = gst_mythtv_src_do_seek;
23.282 - gstpushsrc_class->create = gst_mythtv_src_create;
23.283 -
23.284 - GST_DEBUG_CATEGORY_INIT (mythtvsrc_debug, "mythtvsrc", 0,
23.285 - "MythTV Client Source");
23.286 -}
23.287 -
23.288 -static void
23.289 -gst_mythtv_src_init (GstMythtvSrc * this, GstMythtvSrcClass * g_class)
23.290 -{
23.291 - this->file = NULL;
23.292 -
23.293 - this->unique_setup = FALSE;
23.294 -
23.295 - this->mythtv_version = GMYTHTV_VERSION_DEFAULT;
23.296 -
23.297 - this->state = GST_MYTHTV_SRC_FILE_TRANSFER;
23.298 -
23.299 - this->bytes_read = 0;
23.300 -
23.301 - this->prev_content_size = 0;
23.302 -
23.303 - this->content_size = 0;
23.304 - this->read_offset = 0;
23.305 -
23.306 - this->content_size_last = 0;
23.307 -
23.308 - this->live_tv = FALSE;
23.309 -
23.310 - this->enable_timing_position = FALSE;
23.311 - this->update_prog_chain = FALSE;
23.312 -
23.313 - this->user_agent = g_strdup ("mythtvsrc");
23.314 - this->update_prog_chain = FALSE;
23.315 -
23.316 - this->channel_name = NULL;
23.317 -
23.318 - this->eos = FALSE;
23.319 -
23.320 - this->bytes_queue = NULL;
23.321 -
23.322 - this->wait_to_transfer = 0;
23.323 - this->try_number = 0;
23.324 - this->max_try = 10;
23.325 -
23.326 - gst_base_src_set_format (GST_BASE_SRC (this), GST_FORMAT_BYTES);
23.327 -
23.328 - gst_pad_set_event_function (GST_BASE_SRC_PAD (GST_BASE_SRC (this)),
23.329 - gst_mythtv_src_handle_event);
23.330 - gst_pad_set_query_function (GST_BASE_SRC_PAD (GST_BASE_SRC (this)),
23.331 - gst_mythtv_src_handle_query);
23.332 -
23.333 -}
23.334 -
23.335 -static void
23.336 -gst_mythtv_src_clear (GstMythtvSrc *mythtv_src)
23.337 -{
23.338 - mythtv_src->unique_setup = FALSE;
23.339 - mythtv_src->try_number = 0;
23.340 -
23.341 - if (mythtv_src->spawn_livetv) {
23.342 - g_object_unref (mythtv_src->spawn_livetv);
23.343 - mythtv_src->spawn_livetv = NULL;
23.344 - }
23.345 -
23.346 - if (mythtv_src->file) {
23.347 - g_object_unref (mythtv_src->file);
23.348 - mythtv_src->file = NULL;
23.349 - }
23.350 -
23.351 - if (mythtv_src->backend_info) {
23.352 - g_object_unref (mythtv_src->backend_info);
23.353 - mythtv_src->backend_info = NULL;
23.354 - }
23.355 -
23.356 - if (mythtv_src->bytes_queue) {
23.357 - g_byte_array_free (mythtv_src->bytes_queue, TRUE);
23.358 - mythtv_src->bytes_queue = NULL;
23.359 - }
23.360 -
23.361 -}
23.362 -
23.363 -static void
23.364 -gst_mythtv_src_finalize (GObject * gobject)
23.365 -{
23.366 - GstMythtvSrc *this = GST_MYTHTV_SRC (gobject);
23.367 -
23.368 - gst_mythtv_src_clear (this);
23.369 -
23.370 - if (this->uri_name) {
23.371 - g_free (this->uri_name);
23.372 - this->uri_name = NULL;
23.373 - }
23.374 -
23.375 - if (this->user_agent) {
23.376 - g_free (this->user_agent);
23.377 - this->user_agent = NULL;
23.378 - }
23.379 -
23.380 - G_OBJECT_CLASS (parent_class)->finalize (gobject);
23.381 -}
23.382 -
23.383 -static GMythFileReadResult
23.384 -do_read_request_response (GstMythtvSrc * src, guint size, GByteArray *data_ptr)
23.385 -{
23.386 - gint read = 0;
23.387 - guint sizetoread = size;
23.388 - gint max_iters = GMYTHTV_TRANSFER_MAX_RESENDS;
23.389 - GMythFileReadResult result;
23.390 -
23.391 - GST_LOG_OBJECT (src, "Starting: Reading %d bytes...", sizetoread);
23.392 -
23.393 - /* Loop sending the Myth File Transfer request:
23.394 - * Retry whilst authentication fails and we supply it. */
23.395 -
23.396 - while (sizetoread == size && --max_iters > 0) {
23.397 - /* if ( gmyth_backend_info_is_local_file(src->backend_info) ) */
23.398 - if ( IS_GMYTH_FILE_LOCAL(src->file) )
23.399 - result = gmyth_file_local_read ( GMYTH_FILE_LOCAL(src->file),
23.400 - data_ptr, sizetoread, src->live_tv);
23.401 - else if ( IS_GMYTH_FILE_TRANSFER(src->file) )
23.402 - result = gmyth_file_transfer_read ( GMYTH_FILE_TRANSFER(src->file),
23.403 - data_ptr, sizetoread, src->live_tv);
23.404 -
23.405 - if (data_ptr->len > 0) {
23.406 - read += data_ptr->len;
23.407 - sizetoread -= data_ptr->len;
23.408 - } else if (data_ptr->len < 0) {
23.409 - if (src->live_tv == FALSE) {
23.410 - result = GMYTH_FILE_READ_EOF;
23.411 - goto eos;
23.412 - } else {
23.413 - if (result == GMYTH_FILE_READ_ERROR) { /* -314 */
23.414 - GST_INFO_OBJECT (src, "[LiveTV] FileTransfer READ_ERROR!");
23.415 - goto done;
23.416 - } else if (result == GMYTH_FILE_READ_NEXT_PROG_CHAIN) { /* -315 */
23.417 - GST_INFO_OBJECT (src,
23.418 - "[LiveTV] FileTransfer - Go to the next program chain!");
23.419 - continue;
23.420 - }
23.421 - goto done;
23.422 - }
23.423 -
23.424 - } else if (data_ptr->len == 0)
23.425 - goto done;
23.426 -
23.427 - if (read == sizetoread)
23.428 - goto done;
23.429 - }
23.430 -
23.431 - if ((read < 0 && !src->live_tv) || max_iters == 0){
23.432 - result = GMYTH_FILE_READ_EOF;
23.433 - goto eos;
23.434 - }
23.435 -
23.436 - goto done;
23.437 -
23.438 -eos:
23.439 - src->eos = TRUE;
23.440 -
23.441 -done:
23.442 - return result;
23.443 -}
23.444 -
23.445 -static GstFlowReturn
23.446 -gst_mythtv_src_create (GstPushSrc * psrc, GstBuffer ** outbuf)
23.447 -{
23.448 - GstMythtvSrc *src;
23.449 - GstFlowReturn ret = GST_FLOW_OK;
23.450 - guint buffer_size_inter = 0;
23.451 -
23.452 - src = GST_MYTHTV_SRC (psrc);
23.453 -
23.454 - /* The caller should know the number of bytes and not read beyond EOS. */
23.455 - if (G_UNLIKELY (src->eos))
23.456 - goto eos;
23.457 - if (G_UNLIKELY (src->update_prog_chain))
23.458 - goto change_progchain;
23.459 -
23.460 - GST_DEBUG_OBJECT (src, "offset = %" G_GUINT64_FORMAT ", size = %d...",
23.461 - src->read_offset, MAX_READ_SIZE);
23.462 -
23.463 - GST_DEBUG_OBJECT (src, "Create: buffer_remain: %d, buffer_size = %d.",
23.464 - (gint) src->buffer_remain, src->bytes_queue->len);
23.465 -
23.466 -program_chain_changed:
23.467 - /* just get from the byte array, no network effort... */
23.468 - if ((src->buffer_remain = src->bytes_queue->len) < MAX_READ_SIZE) {
23.469 - GByteArray *buffer;
23.470 - GMythFileReadResult result = GMYTH_FILE_READ_OK;
23.471 -
23.472 - buffer = NULL;
23.473 - buffer_size_inter = (INTERNAL_BUFFER_SIZE - src->buffer_remain);
23.474 -
23.475 - if (buffer_size_inter > REQUEST_MAX_SIZE)
23.476 - buffer_size_inter = REQUEST_MAX_SIZE;
23.477 -
23.478 - buffer = g_byte_array_new ();
23.479 -
23.480 - result = do_read_request_response (src, buffer_size_inter, buffer);
23.481 -
23.482 - if (G_UNLIKELY (buffer->len < 0)) {
23.483 -
23.484 - if (buffer != NULL) {
23.485 - g_byte_array_free (buffer, TRUE);
23.486 - buffer = NULL;
23.487 - }
23.488 -
23.489 - if (src->live_tv || ( result == GMYTH_FILE_READ_NEXT_PROG_CHAIN ))
23.490 - goto change_progchain;
23.491 - else
23.492 - goto read_error;
23.493 - } else if (G_UNLIKELY (read == 0)) {
23.494 -
23.495 - if (buffer != NULL) {
23.496 - g_byte_array_free (buffer, TRUE);
23.497 - buffer = NULL;
23.498 - }
23.499 -
23.500 - if (!src->live_tv)
23.501 - goto done;
23.502 - else
23.503 - goto program_chain_changed;
23.504 - }
23.505 -
23.506 - if (G_UNLIKELY (src->update_prog_chain))
23.507 - {
23.508 - if (buffer != NULL) {
23.509 - g_byte_array_free (buffer, TRUE);
23.510 - buffer = NULL;
23.511 - }
23.512 - goto change_progchain;
23.513 - }
23.514 -
23.515 - src->bytes_queue =
23.516 - g_byte_array_append (src->bytes_queue, buffer->data, buffer->len);
23.517 - if (buffer->len > buffer_size_inter)
23.518 - GST_WARNING_OBJECT (src,
23.519 - "INCREASED buffer size! Backend sent more than we ask him... (%d)",
23.520 - abs (buffer->len - buffer_size_inter));
23.521 -
23.522 - src->buffer_remain += buffer->len;
23.523 -
23.524 - if (buffer != NULL) {
23.525 - g_byte_array_free (buffer, TRUE);
23.526 - buffer = NULL;
23.527 - }
23.528 -
23.529 - GST_DEBUG_OBJECT (src,
23.530 - "BYTES READ (actual) = %d, BYTES READ (cumulative) = %llu, "
23.531 - "OFFSET = %llu, CONTENT SIZE = %llu.", read,
23.532 - src->bytes_read, src->read_offset, src->content_size);
23.533 -
23.534 - }
23.535 -
23.536 - guint buffer_size =
23.537 - (src->buffer_remain < MAX_READ_SIZE) ? src->buffer_remain : MAX_READ_SIZE;
23.538 -
23.539 - *outbuf = gst_buffer_new ();
23.540 -
23.541 - /* gets the first buffer_size bytes from the byte array buffer variable */
23.542 - /* guint8 *buf = g_memdup( src->bytes_queue->data, buffer_size ); */
23.543 -
23.544 - GST_DEBUG_OBJECT (src, "read from network? %s!, buffer_remain = %d",
23.545 - (buffer_size_inter ==
23.546 - 0) ? "NO, got from buffer" : "YES, go see the backend's log file",
23.547 - src->buffer_remain);
23.548 -
23.549 - GST_BUFFER_SIZE (*outbuf) = buffer_size;
23.550 - GST_BUFFER_MALLOCDATA (*outbuf) = g_malloc0 (GST_BUFFER_SIZE (*outbuf));
23.551 - GST_BUFFER_DATA (*outbuf) = GST_BUFFER_MALLOCDATA (*outbuf);
23.552 - g_memmove (GST_BUFFER_DATA ((*outbuf)), src->bytes_queue->data,
23.553 - GST_BUFFER_SIZE (*outbuf));
23.554 - GST_BUFFER_OFFSET (*outbuf) = src->read_offset;
23.555 - GST_BUFFER_OFFSET_END (*outbuf) =
23.556 - src->read_offset + GST_BUFFER_SIZE (*outbuf);
23.557 -
23.558 - src->buffer_remain -= GST_BUFFER_SIZE (*outbuf);
23.559 -
23.560 - src->read_offset += GST_BUFFER_SIZE (*outbuf);
23.561 - src->bytes_read += GST_BUFFER_SIZE (*outbuf);
23.562 - GST_DEBUG_OBJECT (src, "Buffer output with size: %d",
23.563 - GST_BUFFER_SIZE (*outbuf));
23.564 -
23.565 - /* flushs the newly buffer got from byte array */
23.566 - src->bytes_queue =
23.567 - g_byte_array_remove_range (src->bytes_queue, 0, buffer_size);
23.568 -
23.569 - GST_DEBUG_OBJECT ( src, "Got buffer: BUFFER --->SIZE = %d, OFFSET = %llu, "
23.570 - "OFFSET_END = %llu.", GST_BUFFER_SIZE (*outbuf),
23.571 - GST_BUFFER_OFFSET (*outbuf), GST_BUFFER_OFFSET_END (*outbuf) );
23.572 -
23.573 - GST_DEBUG_OBJECT (src, "CONTENT_SIZE = %llu, BYTES_READ = %llu.",
23.574 - src->content_size, src->bytes_read);
23.575 -
23.576 - if ( G_UNLIKELY (src->eos) || ( !src->live_tv
23.577 - && ( src->bytes_read >= src->content_size ) ) )
23.578 - goto eos;
23.579 -
23.580 -done:
23.581 - {
23.582 - const gchar *reason = gst_flow_get_name (ret);
23.583 -
23.584 - GST_DEBUG_OBJECT (src, "DONE task, reason %s", reason);
23.585 - return ret;
23.586 - }
23.587 -eos:
23.588 - {
23.589 - const gchar *reason = gst_flow_get_name (ret);
23.590 -
23.591 - GST_DEBUG_OBJECT (src, "pausing task, reason %s", reason);
23.592 - return GST_FLOW_UNEXPECTED;
23.593 - }
23.594 - /* ERRORS */
23.595 -read_error:
23.596 - {
23.597 - GST_ELEMENT_ERROR (src, RESOURCE, READ,
23.598 - (NULL), ("Could not read any bytes (%i, %s)", read, src->uri_name));
23.599 - return GST_FLOW_ERROR;
23.600 - }
23.601 -change_progchain:
23.602 - {
23.603 - GST_ELEMENT_ERROR (src, RESOURCE, READ,
23.604 - (NULL), ("Seek failed, go to the next program info... (%i, %s)", read,
23.605 - src->uri_name));
23.606 -
23.607 -/*
23.608 - TODO: need to send a new segment event to NUVDemux?
23.609 - gst_pad_push_event (GST_BASE_SRC_PAD (GST_BASE_SRC (psrc)),
23.610 - gst_event_new_new_segment (TRUE, 1.0, GST_FORMAT_TIME, 0, -1, 0));
23.611 -*/
23.612 -
23.613 - goto program_chain_changed;
23.614 - }
23.615 -
23.616 -}
23.617 -
23.618 -gint64
23.619 -gst_mythtv_src_get_position (GstMythtvSrc * src)
23.620 -{
23.621 -
23.622 - gint64 size_tmp = 0;
23.623 - guint max_tries = 2;
23.624 -
23.625 - if (src->live_tv == TRUE && (abs (src->content_size - src->bytes_read) <
23.626 - GMYTHTV_TRANSFER_MAX_BUFFER)) {
23.627 -
23.628 - get_file_pos:
23.629 - g_usleep (10);
23.630 - size_tmp = gmyth_recorder_get_file_position (src->spawn_livetv->recorder);
23.631 - if (size_tmp > (src->content_size + GMYTHTV_TRANSFER_MAX_BUFFER))
23.632 - src->content_size = size_tmp;
23.633 - else if (size_tmp > 0 && --max_tries > 0)
23.634 - goto get_file_pos;
23.635 - GST_LOG_OBJECT (src, "GET_POSITION: file_position = %lld", size_tmp);
23.636 - /* sets the last content size amount before it can be updated */
23.637 - src->prev_content_size = src->content_size;
23.638 - }
23.639 -
23.640 - return src->content_size;
23.641 -
23.642 -}
23.643 -
23.644 -static gboolean
23.645 -gst_mythtv_src_do_seek (GstBaseSrc * base, GstSegment * segment)
23.646 -{
23.647 - GstMythtvSrc *src = GST_MYTHTV_SRC (base);
23.648 - gint64 new_offset = -1;
23.649 - gint64 actual_seek = segment->start;
23.650 - gboolean ret = TRUE;
23.651 -
23.652 - GST_LOG_OBJECT (src, "seek, segment: %" GST_SEGMENT_FORMAT, segment);
23.653 -
23.654 - if (segment->format == GST_FORMAT_TIME) {
23.655 - goto done;
23.656 - }
23.657 - GST_LOG_OBJECT (src,
23.658 - "Trying to seek at the value (actual_seek = %lld, read_offset = %lld)",
23.659 - actual_seek, src->read_offset);
23.660 - /* verify if it needs to seek */
23.661 - if (src->read_offset != actual_seek) {
23.662 -
23.663 - /* if ( gmyth_backend_info_is_local_file(src->backend_info) ) */
23.664 - if ( IS_GMYTH_FILE_LOCAL(src->file) )
23.665 - new_offset =
23.666 - gmyth_file_local_seek ( GMYTH_FILE_LOCAL(src->file), segment->start, G_SEEK_SET);
23.667 - else if ( IS_GMYTH_FILE_TRANSFER(src->file) )
23.668 - new_offset =
23.669 - gmyth_file_transfer_seek ( GMYTH_FILE_TRANSFER(src->file), segment->start, SEEK_SET);
23.670 -
23.671 - GST_LOG_OBJECT (src,
23.672 - "Segment offset start = %lld, SRC Offset = %lld, NEW actual backend SEEK Offset = %lld.",
23.673 - segment->start, src->read_offset, new_offset);
23.674 - if (G_UNLIKELY (new_offset < 0)) {
23.675 - ret = FALSE;
23.676 - if (!src->live_tv)
23.677 - goto eos;
23.678 - }
23.679 -
23.680 - src->read_offset = new_offset;
23.681 -
23.682 - if (ret == FALSE) {
23.683 - GST_INFO_OBJECT (src, "Failed to set the SEEK on segment!");
23.684 - }
23.685 -
23.686 - }
23.687 -
23.688 -done:
23.689 - return ret;
23.690 -
23.691 -eos:
23.692 - {
23.693 - GST_DEBUG_OBJECT (src, "EOS found on seeking!!!");
23.694 - return FALSE;
23.695 - }
23.696 -
23.697 -}
23.698 -
23.699 -/* create a socket for connecting to remote server */
23.700 -static gboolean
23.701 -gst_mythtv_src_start (GstBaseSrc * bsrc)
23.702 -{
23.703 - GstMythtvSrc *src = GST_MYTHTV_SRC (bsrc);
23.704 -
23.705 - GString *chain_id_local = NULL;
23.706 - GMythURI *gmyth_uri = NULL;
23.707 - gboolean ret = TRUE;
23.708 -
23.709 - if (src->unique_setup == FALSE) {
23.710 - src->unique_setup = TRUE;
23.711 - } else {
23.712 - goto done;
23.713 - }
23.714 -
23.715 - gmyth_uri = gmyth_uri_new_with_value (src->uri_name);
23.716 - src->backend_info = gmyth_backend_info_new_with_uri (src->uri_name);
23.717 - src->live_tv = gmyth_uri_is_livetv( gmyth_uri );
23.718 - /* testing UPnP... */
23.719 - /* gmyth_backend_info_set_hostname( src->backend_info, NULL ); */
23.720 - if ( src->live_tv ) {
23.721 - src->spawn_livetv = gmyth_livetv_new (src->backend_info);
23.722 -
23.723 - gchar* ch = gmyth_uri_get_channel_name( gmyth_uri );
23.724 - if ( ch != NULL )
23.725 - src->channel_name = ch;
23.726 -
23.727 - if (src->channel_name != NULL) {
23.728 - if (gmyth_livetv_channel_name_setup (src->spawn_livetv, src->channel_name) == FALSE) {
23.729 - GST_INFO_OBJECT (src, "LiveTV setup felt down on error");
23.730 - ret = FALSE;
23.731 - goto init_failed;
23.732 - }
23.733 - } else {
23.734 - if (gmyth_livetv_setup (src->spawn_livetv) == FALSE) {
23.735 - GST_INFO_OBJECT (src, "LiveTV setup felt down on error");
23.736 - ret = FALSE;
23.737 - goto init_failed;
23.738 - }
23.739 - }
23.740 -
23.741 - /* testing change channel... */
23.742 - /* gmyth_recorder_change_channel( src->spawn_livetv->recorder, CHANNEL_DIRECTION_UP ); */
23.743 -
23.744 - src->file = GMYTH_FILE( gmyth_livetv_create_file_transfer (src->spawn_livetv) );
23.745 -
23.746 - if (NULL == src->file) {
23.747 - GST_INFO_OBJECT (src, "[LiveTV] FileTransfer equals to NULL");
23.748 - ret = FALSE;
23.749 - goto init_failed;
23.750 - }
23.751 -
23.752 - /* Check if the file is local to this specific client renderer */
23.753 - if ( gmyth_uri_is_local_file(gmyth_uri) )
23.754 - ret = gmyth_file_local_open( GMYTH_FILE_LOCAL(src->file) );
23.755 - else
23.756 - ret = gmyth_file_transfer_open( GMYTH_FILE_TRANSFER(src->file), src->spawn_livetv->uri != NULL ?
23.757 - gmyth_uri_get_path(src->spawn_livetv->uri) :
23.758 - src->spawn_livetv->proginfo->pathname->str );
23.759 -
23.760 - /* sets the mythtvsrc "location" property */
23.761 - g_object_set (src, "location", gmyth_file_get_uri (src->file), NULL);
23.762 -
23.763 - if ( !ret )
23.764 - {
23.765 - GST_INFO_OBJECT (src, "Error: couldn't open the FileTransfer from LiveTV source!" );
23.766 - g_object_unref( src->file );
23.767 - src->file = NULL;
23.768 - goto init_failed;
23.769 - }
23.770 - } else {
23.771 -
23.772 - /* Check if the file is local to this specific client renderer, and tries to open
23.773 - * a local connection
23.774 - */
23.775 - if ( gmyth_uri_is_local_file(gmyth_uri) )
23.776 - {
23.777 - src->file = GMYTH_FILE(gmyth_file_local_new(src->backend_info));
23.778 - ret = gmyth_file_local_open ( GMYTH_FILE_LOCAL( src->file ) );
23.779 - } else {
23.780 - src->file = GMYTH_FILE(gmyth_file_transfer_new(src->backend_info));
23.781 - ret = gmyth_file_transfer_open ( GMYTH_FILE_TRANSFER(src->file), src->uri_name );
23.782 - }
23.783 -
23.784 - } /* if (else) - recorded FileTransfer */
23.785 -
23.786 - if (NULL == src->file) {
23.787 - GST_INFO_OBJECT (src, "FileTransfer is NULL");
23.788 - goto init_failed;
23.789 - }
23.790 - /*GST_INFO_OBJECT( src, "uri = %s", src->spawn_livetv->file); */
23.791 -
23.792 - if (ret == FALSE) {
23.793 -#ifndef GST_DISABLE_GST_DEBUG
23.794 - if (src->mythtv_msgs_dbg)
23.795 - GST_INFO_OBJECT (src,
23.796 - "MythTV FileTransfer request failed when setting up socket connection!");
23.797 -#endif
23.798 - goto begin_req_failed;
23.799 - }
23.800 -
23.801 - GST_INFO_OBJECT (src,
23.802 - "MythTV FileTransfer filesize = %lld, content_size = %lld!",
23.803 - gmyth_file_get_filesize( src->file ), src->content_size);
23.804 -
23.805 - src->content_size = gmyth_file_get_filesize (src->file);
23.806 -
23.807 - src->do_start = FALSE;
23.808 -
23.809 - /* this is used for the buffer cache */
23.810 - src->bytes_queue = g_byte_array_sized_new (INTERNAL_BUFFER_SIZE);
23.811 - src->buffer_remain = 0;
23.812 -
23.813 - gst_pad_push_event (GST_BASE_SRC_PAD (GST_BASE_SRC (src)),
23.814 - gst_event_new_new_segment (TRUE, 1.0, GST_FORMAT_TIME, 0,
23.815 - src->content_size, 0));
23.816 -
23.817 -done:
23.818 - if (gmyth_uri != NULL)
23.819 - {
23.820 - g_object_unref (gmyth_uri);
23.821 - gmyth_uri = NULL;
23.822 - }
23.823 -
23.824 - if (chain_id_local != NULL) {
23.825 - g_string_free (chain_id_local, TRUE);
23.826 - chain_id_local = NULL;
23.827 - }
23.828 -
23.829 - return TRUE;
23.830 -
23.831 - /* ERRORS */
23.832 -init_failed:
23.833 - if (gmyth_uri != NULL)
23.834 - {
23.835 - g_object_unref (gmyth_uri);
23.836 - gmyth_uri = NULL;
23.837 - }
23.838 -
23.839 - if (src->spawn_livetv != NULL) {
23.840 - g_object_unref (src->spawn_livetv);
23.841 - src->spawn_livetv = NULL;
23.842 - }
23.843 -
23.844 - /*
23.845 - GST_ELEMENT_ERROR (src, LIBRARY, INIT,
23.846 - (NULL), ("Could not initialize MythTV library (%i, %s)", ret,
23.847 - src->uri_name));
23.848 - */
23.849 -
23.850 - if (++src->try_number <= src->max_try) {
23.851 - gst_mythtv_src_clear (src);
23.852 - GST_DEBUG_OBJECT (src, "Starting new try for get free recorder on MythTV");
23.853 - g_usleep (0.5 * G_USEC_PER_SEC);
23.854 - return gst_mythtv_src_start (bsrc);
23.855 - }
23.856 -
23.857 - return FALSE;
23.858 -begin_req_failed:
23.859 - if (gmyth_uri != NULL)
23.860 - {
23.861 - g_object_unref (gmyth_uri);
23.862 - gmyth_uri = NULL;
23.863 - }
23.864 -
23.865 - GST_ELEMENT_ERROR (src, LIBRARY, INIT,
23.866 - (NULL), ("Could not begin request sent to MythTV server (%i, %s)", ret,
23.867 - src->uri_name));
23.868 - return FALSE;
23.869 -
23.870 -}
23.871 -
23.872 -static gboolean
23.873 -gst_mythtv_src_get_size (GstBaseSrc * bsrc, guint64 * size)
23.874 -{
23.875 - GstMythtvSrc *src = GST_MYTHTV_SRC (bsrc);
23.876 - gboolean ret = TRUE;
23.877 -
23.878 - GST_LOG_OBJECT (src, "Differs from previous content size: %d (max.: %d)",
23.879 - abs (src->content_size - src->prev_content_size),
23.880 - GMYTHTV_TRANSFER_MAX_BUFFER);
23.881 -
23.882 - if (src->live_tv) {
23.883 - ret = FALSE;
23.884 - } else if (src->live_tv && src->enable_timing_position
23.885 - && (abs (src->content_size - src->bytes_read) <
23.886 - GMYTHTV_TRANSFER_MAX_BUFFER)) {
23.887 -
23.888 - gint64 new_offset =
23.889 - gmyth_recorder_get_file_position (src->spawn_livetv->recorder);
23.890 - if (new_offset > 0 && new_offset > src->content_size) {
23.891 - src->content_size = new_offset;
23.892 - } else if (new_offset < src->content_size) {
23.893 - src->update_prog_chain = TRUE;
23.894 - }
23.895 -
23.896 - }
23.897 -
23.898 - *size = src->content_size;
23.899 - GST_LOG_OBJECT (src, "Content size = %lld", src->content_size);
23.900 -
23.901 - return ret;
23.902 -
23.903 -}
23.904 -
23.905 -/* close the socket and associated resources
23.906 - * used both to recover from errors and go to NULL state */
23.907 -static gboolean
23.908 -gst_mythtv_src_stop (GstBaseSrc * bsrc)
23.909 -{
23.910 - GstMythtvSrc *src = GST_MYTHTV_SRC (bsrc);
23.911 -
23.912 - gst_mythtv_src_clear (src);
23.913 -
23.914 - /* src->eos = FALSE; */
23.915 -
23.916 - return TRUE;
23.917 -}
23.918 -
23.919 -static gboolean
23.920 -gst_mythtv_src_handle_event (GstPad * pad, GstEvent * event)
23.921 -{
23.922 - GstMythtvSrc *src = GST_MYTHTV_SRC (GST_PAD_PARENT (pad));
23.923 - gint64 cont_size = 0;
23.924 - gboolean ret = FALSE;
23.925 -
23.926 - switch (GST_EVENT_TYPE (event)) {
23.927 - case GST_EVENT_EOS:
23.928 - GST_WARNING_OBJECT (src, "Got EOS event");
23.929 -
23.930 - if (src->live_tv) {
23.931 - cont_size = gst_mythtv_src_get_position (src);
23.932 - if (cont_size > src->content_size) {
23.933 - src->content_size = cont_size;
23.934 - src->eos = FALSE;
23.935 - } else {
23.936 - src->eos = TRUE;
23.937 - gst_element_set_state (GST_ELEMENT (src), GST_STATE_NULL);
23.938 - gst_element_set_locked_state (GST_ELEMENT (src), FALSE);
23.939 - }
23.940 - }
23.941 - break;
23.942 - default:
23.943 - ret = gst_pad_event_default (pad, event);
23.944 - }
23.945 -
23.946 - return ret;
23.947 -}
23.948 -
23.949 -static gboolean
23.950 -gst_mythtv_src_is_seekable (GstBaseSrc * push_src)
23.951 -{
23.952 - return TRUE;
23.953 -}
23.954 -
23.955 -static gboolean
23.956 -gst_mythtv_src_handle_query (GstPad * pad, GstQuery * query)
23.957 -{
23.958 - gboolean res = FALSE;
23.959 - GstMythtvSrc *myth = GST_MYTHTV_SRC (gst_pad_get_parent (pad));
23.960 - GstFormat formt;
23.961 -
23.962 - switch (GST_QUERY_TYPE (query)) {
23.963 - case GST_QUERY_POSITION:
23.964 - {
23.965 - gst_query_parse_position (query, &formt, NULL);
23.966 - if (formt == GST_FORMAT_BYTES) {
23.967 - gst_query_set_position (query, formt, myth->read_offset);
23.968 - GST_DEBUG_OBJECT (myth, "POS %" G_GINT64_FORMAT, myth->read_offset);
23.969 - res = TRUE;
23.970 - } else if (formt == GST_FORMAT_TIME) {
23.971 - res = gst_pad_query_default (pad, query);
23.972 - }
23.973 - break;
23.974 - }
23.975 - case GST_QUERY_DURATION:
23.976 - {
23.977 -#if 0
23.978 - if (myth->duration != 0) {
23.979 - gint64 total;
23.980 - gint64 fps;
23.981 -
23.982 - fps = nuv->h->i_fpsn / nuv->h->i_fpsd;
23.983 - total =
23.984 - gst_util_uint64_scale_int (GST_SECOND, nuv->h->i_video_blocks, fps);
23.985 - }
23.986 -#endif
23.987 -
23.988 - gst_query_parse_duration (query, &formt, NULL);
23.989 - if (formt == GST_FORMAT_BYTES) {
23.990 - gst_query_set_duration (query, formt, myth->content_size);
23.991 - GST_DEBUG_OBJECT (myth, "SIZE %" G_GINT64_FORMAT, myth->content_size);
23.992 - res = TRUE;
23.993 - } else if (formt == GST_FORMAT_TIME) {
23.994 - res = gst_pad_query_default (pad, query);
23.995 - }
23.996 - break;
23.997 - }
23.998 - default:
23.999 - {
23.1000 - res = gst_pad_query_default (pad, query);
23.1001 - break;
23.1002 - }
23.1003 - }
23.1004 -
23.1005 - gst_object_unref (myth);
23.1006 -
23.1007 - return res;
23.1008 -}
23.1009 -
23.1010 -static GstStateChangeReturn
23.1011 -gst_mythtv_src_change_state (GstElement * element, GstStateChange transition)
23.1012 -{
23.1013 - GstStateChangeReturn ret = GST_STATE_CHANGE_FAILURE;
23.1014 - GstMythtvSrc *src = GST_MYTHTV_SRC (element);
23.1015 -
23.1016 - switch (transition) {
23.1017 - case GST_STATE_CHANGE_NULL_TO_READY:
23.1018 - break;
23.1019 - case GST_STATE_CHANGE_READY_TO_PAUSED:
23.1020 - case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
23.1021 - if (src->live_tv) {
23.1022 - if (!gmyth_recorder_send_frontend_ready_command (src->spawn_livetv->
23.1023 - recorder))
23.1024 - GST_WARNING_OBJECT (src,
23.1025 - "Couldn't send the FRONTEND_READY message to the backend!");
23.1026 - else
23.1027 - GST_DEBUG_OBJECT (src, "FRONTEND_READY was sent to the backend");
23.1028 - }
23.1029 - break;
23.1030 - default:
23.1031 - break;
23.1032 - }
23.1033 -
23.1034 - ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
23.1035 - if (ret == GST_STATE_CHANGE_FAILURE)
23.1036 - return ret;
23.1037 -
23.1038 - switch (transition) {
23.1039 - case GST_STATE_CHANGE_READY_TO_NULL:
23.1040 - break;
23.1041 - case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
23.1042 - case GST_STATE_CHANGE_PAUSED_TO_READY:
23.1043 - break;
23.1044 - default:
23.1045 - break;
23.1046 - }
23.1047 -
23.1048 - return ret;
23.1049 -}
23.1050 -
23.1051 -static void
23.1052 -gst_mythtv_src_set_property (GObject * object, guint prop_id,
23.1053 - const GValue * value, GParamSpec * pspec)
23.1054 -{
23.1055 - GstMythtvSrc *mythtvsrc = GST_MYTHTV_SRC (object);
23.1056 -
23.1057 - GST_OBJECT_LOCK (mythtvsrc);
23.1058 - switch (prop_id) {
23.1059 - case PROP_LOCATION:
23.1060 - {
23.1061 - if (!g_value_get_string (value)) {
23.1062 - GST_WARNING ("location property cannot be NULL");
23.1063 - break;
23.1064 - }
23.1065 -
23.1066 - if (mythtvsrc->uri_name != NULL) {
23.1067 - g_free (mythtvsrc->uri_name);
23.1068 - mythtvsrc->uri_name = NULL;
23.1069 - }
23.1070 - mythtvsrc->uri_name = g_value_dup_string (value);
23.1071 -
23.1072 - break;
23.1073 - }
23.1074 -#ifndef GST_DISABLE_GST_DEBUG
23.1075 - case PROP_GMYTHTV_DBG:
23.1076 - {
23.1077 - mythtvsrc->mythtv_msgs_dbg = g_value_get_boolean (value);
23.1078 - break;
23.1079 - }
23.1080 -#endif
23.1081 - case PROP_GMYTHTV_VERSION:
23.1082 - {
23.1083 - mythtvsrc->mythtv_version = g_value_get_int (value);
23.1084 - break;
23.1085 - }
23.1086 - case PROP_GMYTHTV_LIVEID:
23.1087 - {
23.1088 - mythtvsrc->live_tv_id = g_value_get_int (value);
23.1089 - break;
23.1090 - }
23.1091 - case PROP_GMYTHTV_LIVE:
23.1092 - {
23.1093 - mythtvsrc->live_tv = g_value_get_boolean (value);
23.1094 - break;
23.1095 - }
23.1096 - case PROP_GMYTHTV_ENABLE_TIMING_POSITION:
23.1097 - {
23.1098 - mythtvsrc->enable_timing_position = g_value_get_boolean (value);
23.1099 - break;
23.1100 - }
23.1101 - case PROP_GMYTHTV_LIVE_CHAINID:
23.1102 - {
23.1103 - if (!g_value_get_string (value)) {
23.1104 - GST_WARNING ("MythTV Live chainid property cannot be NULL");
23.1105 - break;
23.1106 - }
23.1107 -
23.1108 - if (mythtvsrc->live_chain_id != NULL) {
23.1109 - g_free (mythtvsrc->live_chain_id);
23.1110 - mythtvsrc->live_chain_id = NULL;
23.1111 - }
23.1112 - mythtvsrc->live_chain_id = g_value_dup_string (value);
23.1113 - break;
23.1114 - }
23.1115 - case PROP_GMYTHTV_CHANNEL_NUM:
23.1116 - {
23.1117 - mythtvsrc->channel_name = g_value_dup_string (value);
23.1118 - break;
23.1119 - }
23.1120 - case PROP_GMYTHTV_MAX_TRY:
23.1121 - {
23.1122 - mythtvsrc->max_try = g_value_get_int (value);
23.1123 - break;
23.1124 - }
23.1125 - default:
23.1126 - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
23.1127 - break;
23.1128 - }
23.1129 -
23.1130 - GST_OBJECT_UNLOCK (mythtvsrc);
23.1131 -}
23.1132 -
23.1133 -static void
23.1134 -gst_mythtv_src_get_property (GObject * object, guint prop_id,
23.1135 - GValue * value, GParamSpec * pspec)
23.1136 -{
23.1137 - GstMythtvSrc *mythtvsrc = GST_MYTHTV_SRC (object);
23.1138 -
23.1139 - GST_OBJECT_LOCK (mythtvsrc);
23.1140 - switch (prop_id) {
23.1141 - case PROP_LOCATION:
23.1142 - {
23.1143 - g_value_set_string (value, mythtvsrc->uri_name);
23.1144 - break;
23.1145 - }
23.1146 -#ifndef GST_DISABLE_GST_DEBUG
23.1147 - case PROP_GMYTHTV_DBG:
23.1148 - g_value_set_boolean (value, mythtvsrc->mythtv_msgs_dbg);
23.1149 - break;
23.1150 -#endif
23.1151 - case PROP_GMYTHTV_VERSION:
23.1152 - {
23.1153 - g_value_set_int (value, mythtvsrc->mythtv_version);
23.1154 - break;
23.1155 - }
23.1156 - case PROP_GMYTHTV_LIVEID:
23.1157 - {
23.1158 - g_value_set_int (value, mythtvsrc->live_tv_id);
23.1159 - break;
23.1160 - }
23.1161 - case PROP_GMYTHTV_LIVE:
23.1162 - g_value_set_boolean (value, mythtvsrc->live_tv);
23.1163 - break;
23.1164 - case PROP_GMYTHTV_ENABLE_TIMING_POSITION:
23.1165 - g_value_set_boolean (value, mythtvsrc->enable_timing_position);
23.1166 - break;
23.1167 - case PROP_GMYTHTV_LIVE_CHAINID:
23.1168 - {
23.1169 - g_value_set_string (value, mythtvsrc->live_chain_id);
23.1170 - break;
23.1171 - }
23.1172 - case PROP_GMYTHTV_CHANNEL_NUM:
23.1173 - {
23.1174 - g_value_set_string (value, mythtvsrc->channel_name);
23.1175 - break;
23.1176 - }
23.1177 - case PROP_GMYTHTV_MAX_TRY:
23.1178 - {
23.1179 - g_value_set_int (value, mythtvsrc->max_try);
23.1180 - break;
23.1181 - }
23.1182 -
23.1183 - default:
23.1184 - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
23.1185 - break;
23.1186 - }
23.1187 - GST_OBJECT_UNLOCK (mythtvsrc);
23.1188 -}
23.1189 -
23.1190 -static gboolean
23.1191 -plugin_init (GstPlugin * plugin)
23.1192 -{
23.1193 - return gst_element_register (plugin, "mythtvsrc", GST_RANK_NONE,
23.1194 - GST_TYPE_MYTHTV_SRC);
23.1195 -}
23.1196 -
23.1197 -GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
23.1198 - GST_VERSION_MINOR,
23.1199 - "mythtv",
23.1200 - "lib MythTV src",
23.1201 - plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN);
23.1202 -
23.1203 -
23.1204 -/*** GSTURIHANDLER INTERFACE *************************************************/
23.1205 -static guint
23.1206 -gst_mythtv_src_uri_get_type (void)
23.1207 -{
23.1208 - return GST_URI_SRC;
23.1209 -}
23.1210 -
23.1211 -static gchar **
23.1212 -gst_mythtv_src_uri_get_protocols (void)
23.1213 -{
23.1214 - static gchar *protocols[] = { "myth", "myths", NULL };
23.1215 -
23.1216 - return protocols;
23.1217 -}
23.1218 -
23.1219 -static const gchar *
23.1220 -gst_mythtv_src_uri_get_uri (GstURIHandler * handler)
23.1221 -{
23.1222 - GstMythtvSrc *src = GST_MYTHTV_SRC (handler);
23.1223 -
23.1224 - return src->uri_name;
23.1225 -}
23.1226 -
23.1227 -static gboolean
23.1228 -gst_mythtv_src_uri_set_uri (GstURIHandler * handler, const gchar * uri)
23.1229 -{
23.1230 - GstMythtvSrc *src = GST_MYTHTV_SRC (handler);
23.1231 -
23.1232 - gchar *protocol;
23.1233 -
23.1234 - protocol = gst_uri_get_protocol (uri);
23.1235 - if ((strcmp (protocol, "myth") != 0) && (strcmp (protocol, "myths") != 0)) {
23.1236 - g_free (protocol);
23.1237 - return FALSE;
23.1238 - }
23.1239 - g_free (protocol);
23.1240 - g_object_set (src, "location", uri, NULL);
23.1241 -
23.1242 - return TRUE;
23.1243 -}
23.1244 -
23.1245 -static void
23.1246 -gst_mythtv_src_uri_handler_init (gpointer g_iface, gpointer iface_data)
23.1247 -{
23.1248 - GstURIHandlerInterface *iface = (GstURIHandlerInterface *) g_iface;
23.1249 -
23.1250 - iface->get_type = gst_mythtv_src_uri_get_type;
23.1251 - iface->get_protocols = gst_mythtv_src_uri_get_protocols;
23.1252 - iface->get_uri = gst_mythtv_src_uri_get_uri;
23.1253 - iface->set_uri = gst_mythtv_src_uri_set_uri;
23.1254 -}
23.1255 -
23.1256 -void
23.1257 -size_header_handler (void *userdata, const char *value)
23.1258 -{
23.1259 - GstMythtvSrc *src = GST_MYTHTV_SRC (userdata);
23.1260 -
23.1261 - GST_DEBUG_OBJECT (src, "content size = %lld bytes", src->content_size);
23.1262 -}
24.1 --- a/gst-plugins-mythtv/src/gstmythtvsrc.c.new Tue May 01 17:22:20 2007 +0100
24.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
24.3 @@ -1,1033 +0,0 @@
24.4 -/* vim: set sw=2: -*- Mode: C; tab-width: 2; indent-tabs-mode: t; c-basic-offset: 2; c-indent-level: 2 -*- */
24.5 -/* GStreamer MythTV Plug-in
24.6 - * Copyright (C) <2006> Rosfran Borges <rosfran.borges@indt.org.br>
24.7 - *
24.8 - * This library is free software; you can redistribute it and/or
24.9 - * modify it under the terms of the GNU Library General Public
24.10 - * License as published by the Free Software Foundation; either
24.11 - * version 2 of the License, or (at your option) any later version.
24.12 - *
24.13 - * This library is distributed in the hope that it will be useful,
24.14 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
24.15 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24.16 - * Library General Public License for more
24.17 - */
24.18 -
24.19 -#ifdef HAVE_CONFIG_H
24.20 -#include "config.h"
24.21 -#endif
24.22 -
24.23 -#include "gstmythtvsrc.h"
24.24 -#include "myth_file_transfer.h"
24.25 -#include "myth_livetv.h"
24.26 -
24.27 -#include <gmyth/gmyth_socket.h>
24.28 -#include <gmyth/gmyth_tvchain.h>
24.29 -
24.30 -#include <string.h>
24.31 -#include <unistd.h>
24.32 -
24.33 -GST_DEBUG_CATEGORY_STATIC (mythtvsrc_debug);
24.34 -#define GST_CAT_DEFAULT mythtvsrc_debug
24.35 -
24.36 -#define GST_MYTHTV_ID_NUM 1
24.37 -
24.38 -#define MYTHTV_VERSION_DEFAULT 30
24.39 -
24.40 -#define MYTHTV_TRANSFER_MAX_WAITS 100
24.41 -
24.42 -#define MYTHTV_TRANSFER_MAX_BUFFER ( 32*1024 )
24.43 -
24.44 -/* 4*1024 ??? */
24.45 -#define MAX_READ_SIZE ( 16*1024 )
24.46 -
24.47 -#define ENABLE_TIMING_POSITION 1
24.48 -
24.49 -/* stablish a maximum iteration value to the IS_RECORDING message */
24.50 -static guint wait_to_transfer = 0;
24.51 -
24.52 -static const GstElementDetails gst_mythtv_src_details =
24.53 -GST_ELEMENT_DETAILS ("MythTV client source",
24.54 - "Source/Network",
24.55 - "Control and receive data as a client over the network via raw socket connections using the MythTV protocol",
24.56 - "Rosfran Borges <rosfran.borges@indt.org.br>");
24.57 -
24.58 -static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
24.59 - GST_PAD_SRC,
24.60 - GST_PAD_ALWAYS,
24.61 - GST_STATIC_CAPS_ANY);
24.62 -
24.63 -static GstTask *update_size_task = NULL;
24.64 -
24.65 -static GStaticRecMutex update_size_mutex = G_STATIC_REC_MUTEX_INIT;
24.66 -
24.67 -enum
24.68 -{
24.69 - PROP_0,
24.70 - PROP_LOCATION,
24.71 - PROP_URI,
24.72 -#ifndef GST_DISABLE_GST_DEBUG
24.73 - PROP_MYTHTV_DBG,
24.74 -#endif
24.75 - PROP_MYTHTV_VERSION,
24.76 - PROP_MYTHTV_LIVE,
24.77 - PROP_MYTHTV_LIVEID,
24.78 - PROP_MYTHTV_LIVE_CHAINID
24.79 -};
24.80 -
24.81 -static void gst_mythtv_src_finalize (GObject * gobject);
24.82 -
24.83 -static GstFlowReturn gst_mythtv_src_create (GstBaseSrc * psrc,
24.84 - guint64 offset, guint size, GstBuffer ** outbuf);
24.85 -static gboolean gst_mythtv_src_start (GstBaseSrc * bsrc);
24.86 -static gboolean gst_mythtv_src_stop (GstBaseSrc * bsrc);
24.87 -static gboolean gst_mythtv_src_get_size (GstBaseSrc * bsrc, guint64 * size);
24.88 -static gboolean gst_mythtv_src_is_seekable( GstBaseSrc *base_src );
24.89 -
24.90 -static void gst_mythtv_src_set_property (GObject * object, guint prop_id,
24.91 - const GValue * value, GParamSpec * pspec);
24.92 -static void gst_mythtv_src_get_property (GObject * object, guint prop_id,
24.93 - GValue * value, GParamSpec * pspec);
24.94 -
24.95 -static void
24.96 -gst_mythtv_src_uri_handler_init (gpointer g_iface, gpointer iface_data);
24.97 -
24.98 -static gboolean
24.99 -gst_mythtv_src_handle_event (GstPad * pad, GstEvent * event);
24.100 -
24.101 - static void
24.102 -_urihandler_init (GType type)
24.103 -{
24.104 - static const GInterfaceInfo urihandler_info = {
24.105 - gst_mythtv_src_uri_handler_init,
24.106 - NULL,
24.107 - NULL
24.108 - };
24.109 -
24.110 - g_type_add_interface_static (type, GST_TYPE_URI_HANDLER, &urihandler_info);
24.111 -
24.112 - GST_DEBUG_CATEGORY_INIT (mythtvsrc_debug, "mythtvsrc", 0,
24.113 - "MythTV src");
24.114 -}
24.115 -
24.116 -GST_BOILERPLATE_FULL (GstMythtvSrc, gst_mythtv_src, GstBaseSrc,
24.117 - GST_TYPE_BASE_SRC, _urihandler_init);
24.118 -
24.119 - static void
24.120 -gst_mythtv_src_base_init (gpointer g_class)
24.121 -{
24.122 - GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
24.123 -
24.124 - gst_element_class_add_pad_template (element_class,
24.125 - gst_static_pad_template_get (&srctemplate));
24.126 -
24.127 - gst_element_class_set_details (element_class, &gst_mythtv_src_details);
24.128 -}
24.129 -
24.130 - static void
24.131 -gst_mythtv_src_class_init (GstMythtvSrcClass * klass)
24.132 -{
24.133 - GObjectClass *gobject_class;
24.134 - GstBaseSrcClass *gstbasesrc_class;
24.135 -
24.136 - gobject_class = (GObjectClass *) klass;
24.137 - gstbasesrc_class = (GstBaseSrcClass *) klass;
24.138 -
24.139 - gobject_class->set_property = gst_mythtv_src_set_property;
24.140 - gobject_class->get_property = gst_mythtv_src_get_property;
24.141 - gobject_class->finalize = gst_mythtv_src_finalize;
24.142 -
24.143 - g_object_class_install_property
24.144 - (gobject_class, PROP_LOCATION,
24.145 - g_param_spec_string ("location", "Location",
24.146 - "The location. In the form:"
24.147 - "\n\t\t\tmyth://a.com/file.nuv"
24.148 - "\n\t\t\tmyth://a.com:23223/file.nuv "
24.149 - "\n\t\t\ta.com/file.nuv - default scheme 'myth'",
24.150 - "", G_PARAM_READWRITE));
24.151 -
24.152 - g_object_class_install_property
24.153 - (gobject_class, PROP_URI,
24.154 - g_param_spec_string ("uri", "Uri",
24.155 - "The location in form of a URI (deprecated; use location)",
24.156 - "", G_PARAM_READWRITE));
24.157 -
24.158 - g_object_class_install_property
24.159 - (gobject_class, PROP_MYTHTV_VERSION,
24.160 - g_param_spec_int ("mythtv-version", "mythtv-version",
24.161 - "Change Myth TV version",
24.162 - 26, 30, 26, G_PARAM_READWRITE));
24.163 -
24.164 - g_object_class_install_property
24.165 - (gobject_class, PROP_MYTHTV_LIVEID,
24.166 - g_param_spec_int ("mythtv-live-id", "mythtv-live-id",
24.167 - "Change Myth TV version",
24.168 - 0, 200, GST_MYTHTV_ID_NUM, G_PARAM_READWRITE));
24.169 -
24.170 - g_object_class_install_property
24.171 - (gobject_class, PROP_MYTHTV_LIVE_CHAINID,
24.172 - g_param_spec_string ("mythtv-live-chainid", "mythtv-live-chainid",
24.173 - "Sets the Myth TV chain ID (from TV Chain)",
24.174 - "", G_PARAM_READWRITE));
24.175 -
24.176 - g_object_class_install_property
24.177 - (gobject_class, PROP_MYTHTV_LIVE,
24.178 - g_param_spec_boolean ("mythtv-live", "mythtv-live",
24.179 - "Enable MythTV Live TV content streaming",
24.180 - FALSE, G_PARAM_READWRITE));
24.181 -
24.182 -#ifndef GST_DISABLE_GST_DEBUG
24.183 - g_object_class_install_property
24.184 - (gobject_class, PROP_MYTHTV_DBG,
24.185 - g_param_spec_boolean ("mythtv-debug", "mythtv-debug",
24.186 - "Enable MythTV debug messages",
24.187 - FALSE, G_PARAM_READWRITE));
24.188 -#endif
24.189 -
24.190 - gstbasesrc_class->start = gst_mythtv_src_start;
24.191 - gstbasesrc_class->stop = gst_mythtv_src_stop;
24.192 - gstbasesrc_class->get_size = gst_mythtv_src_get_size;
24.193 - gstbasesrc_class->is_seekable = gst_mythtv_src_is_seekable;
24.194 -
24.195 - gstbasesrc_class->create = gst_mythtv_src_create;
24.196 -
24.197 - GST_DEBUG_CATEGORY_INIT (mythtvsrc_debug, "mythtvsrc", 0,
24.198 - "MythTV Client Source");
24.199 -}
24.200 -
24.201 - static void
24.202 -gst_mythtv_src_init (GstMythtvSrc * this, GstMythtvSrcClass * g_class)
24.203 -{
24.204 - this->file_transfer = NULL;
24.205 -
24.206 - this->unique_setup = FALSE;
24.207 -
24.208 - this->mythtv_version = MYTHTV_VERSION_DEFAULT;
24.209 -
24.210 - this->bytes_read = 0;
24.211 -
24.212 - this->content_size = -1;
24.213 - this->read_offset = 0;
24.214 -
24.215 - this->live_tv = FALSE;
24.216 -
24.217 - this->user_agent = g_strdup ("mythtvsrc");
24.218 - this->mythtv_caps = NULL;
24.219 -
24.220 - gst_base_src_set_live ( GST_BASE_SRC( this ), TRUE );
24.221 -
24.222 - gst_pad_set_event_function (GST_BASE_SRC_PAD(GST_BASE_SRC(this)),
24.223 - GST_DEBUG_FUNCPTR (gst_mythtv_src_handle_event));
24.224 -
24.225 -}
24.226 -
24.227 - static void
24.228 -gst_mythtv_src_finalize (GObject * gobject)
24.229 -{
24.230 - GstMythtvSrc *this = GST_MYTHTV_SRC (gobject);
24.231 -
24.232 - g_free (this->user_agent);
24.233 -
24.234 - if (this->mythtv_caps) {
24.235 - gst_caps_unref (this->mythtv_caps);
24.236 - this->mythtv_caps = NULL;
24.237 - }
24.238 -
24.239 - if (this->file_transfer) {
24.240 - g_object_unref (this->file_transfer);
24.241 - this->file_transfer = NULL;
24.242 - }
24.243 -
24.244 - if (this->uri_name) {
24.245 - g_free (this->uri_name);
24.246 - }
24.247 -
24.248 - if (this->user_agent) {
24.249 - g_free (this->user_agent);
24.250 - }
24.251 -
24.252 - if ( update_size_task != NULL ) {
24.253 -
24.254 - if ( GST_TASK_STATE( update_size_task ) != GST_TASK_STOPPED )
24.255 - gst_task_stop( update_size_task );
24.256 -
24.257 - gst_object_unref( update_size_task );
24.258 -
24.259 - update_size_task = NULL;
24.260 -
24.261 - }
24.262 -
24.263 - G_OBJECT_CLASS (parent_class)->finalize (gobject);
24.264 -}
24.265 -
24.266 -#if 0
24.267 - static guint
24.268 -do_seek( GstMythtvSrc *src, guint64 offset, guint size, GstBuffer *outbuf )
24.269 -{
24.270 - guint64 off_uint64 = myth_file_transfer_seek(src->file_transfer, offset, 1);
24.271 -
24.272 - g_print( "[%s] Call MythTV SEEK with offset %llu, got a new one %llu...\n", __FUNCTION__,
24.273 - offset, off_uint64 );
24.274 -
24.275 - return off_uint64;
24.276 -
24.277 -}
24.278 -#endif
24.279 -
24.280 - static guint
24.281 -do_read_request_response (GstMythtvSrc * src, guint64 offset, guint size, GstBuffer * outbuf)
24.282 -{
24.283 - guint read = 0;
24.284 - guint sizetoread = size; //GST_BUFFER_SIZE (outbuf);
24.285 -
24.286 - g_print( "[%s] Reading %d bytes...\n", __FUNCTION__, sizetoread );
24.287 -
24.288 - /* Loop sending the request:
24.289 - * Retry whilst authentication fails and we supply it. */
24.290 -
24.291 - ssize_t len = 0;
24.292 -
24.293 - //GST_OBJECT_LOCK(src);
24.294 -
24.295 - while ( sizetoread > 0 ) {
24.296 -
24.297 - len = myth_file_transfer_read( src->file_transfer,
24.298 - GST_BUFFER_DATA (outbuf) + read, sizetoread, TRUE );
24.299 -
24.300 - if ( len > 0 ) {
24.301 - read += len;
24.302 - src->read_offset += read;
24.303 - sizetoread -= len;
24.304 - } else if ( len < 0 ) {
24.305 - goto done;
24.306 - }
24.307 - else if ( len == 0 ) {
24.308 - if ( src->live_tv == FALSE )
24.309 - goto done;
24.310 - else
24.311 - goto eos;
24.312 -
24.313 - }
24.314 -
24.315 - if ( len == sizetoread )
24.316 - break;
24.317 -
24.318 - }
24.319 -
24.320 - if ( read > 0 ) {
24.321 - src->bytes_read += read;
24.322 -
24.323 - GST_BUFFER_SIZE (outbuf) = read;
24.324 - } else if ( read <= 0 || len <= 0 ) {
24.325 - if ( src->live_tv == FALSE )
24.326 - goto eos;
24.327 - else
24.328 - goto done;
24.329 - }
24.330 - //GST_BUFFER_OFFSET (outbuf) = src->read_offset;
24.331 -
24.332 - g_print( "[%s]\tBYTES READ (actual) = %d, BYTES READ (cumulative) = %llu, "\
24.333 - "OFFSET = %llu, CONTENT SIZE = %llu.\n", __FUNCTION__, read, src->bytes_read,
24.334 - src->read_offset, src->content_size );
24.335 -
24.336 - //GST_OBJECT_UNLOCK(src);
24.337 -
24.338 - if ( len < 0 ) {
24.339 - read = len;
24.340 - if ( src->live_tv == FALSE )
24.341 - goto eos;
24.342 - else
24.343 - goto done;
24.344 - }
24.345 -
24.346 - if ( src->bytes_read < src->content_size )
24.347 - goto done;
24.348 -
24.349 -eos:
24.350 - //GST_OBJECT_UNLOCK(src);
24.351 -
24.352 - src->eos = TRUE;
24.353 -done:
24.354 - //GST_OBJECT_UNLOCK(src);
24.355 -
24.356 - return read;
24.357 -}
24.358 -
24.359 - static GstFlowReturn
24.360 -gst_mythtv_src_create ( GstBaseSrc * psrc, guint64 offset,
24.361 - guint size, GstBuffer **outbuf )
24.362 -{
24.363 - GstMythtvSrc *src;
24.364 - GstFlowReturn ret = GST_FLOW_OK;
24.365 - guint read = 0;
24.366 -
24.367 - src = GST_MYTHTV_SRC (psrc);
24.368 -
24.369 - //src->do_start = FALSE;
24.370 - src->do_start = FALSE;
24.371 - gst_task_join ( update_size_task );
24.372 -
24.373 - g_print( "[%s]\tBUFFER OFFSET = %llu, BUFFER SIZE = %d.\n", __FUNCTION__, offset,
24.374 - size );
24.375 -
24.376 - /* The caller should know the number of bytes and not read beyond EOS. */
24.377 - //if (G_UNLIKELY (src->eos))
24.378 - // goto eos;
24.379 - //g_static_rec_mutex_lock( &update_size_mutex );
24.380 -
24.381 - /* Create the buffer. */
24.382 - ret = gst_pad_alloc_buffer ( GST_BASE_SRC_PAD (GST_BASE_SRC (psrc)),
24.383 - // GST_BUFFER_OFFSET_NONE, GST_BASE_SRC (psrc)->blocksize,
24.384 - offset, size,
24.385 - src->mythtv_caps ? src->mythtv_caps :
24.386 - GST_PAD_CAPS (GST_BASE_SRC_PAD (GST_BASE_SRC (psrc))), outbuf );
24.387 -
24.388 - //if (G_UNLIKELY (ret == GST_FLOW_UNEXPECTED))
24.389 - // goto eos;
24.390 -
24.391 - if (G_UNLIKELY (ret != GST_FLOW_OK))
24.392 - goto eos;
24.393 -
24.394 - if (G_UNLIKELY (ret == GST_FLOW_ERROR))
24.395 - goto read_error;
24.396 -
24.397 - read = do_read_request_response ( src, offset, size, *outbuf );
24.398 -
24.399 - //g_static_rec_mutex_unlock( &update_size_mutex );
24.400 -
24.401 - src->do_start = TRUE;
24.402 - gst_task_start ( update_size_task );
24.403 -
24.404 -#if 0
24.405 - g_static_rec_mutex_lock( &update_size_mutex );
24.406 - src->do_start = FALSE;
24.407 - g_static_rec_mutex_unlock( &update_size_mutex );
24.408 - GST_TASK_SIGNAL( update_size_task );
24.409 -#endif
24.410 -
24.411 - //g_static_rec_mutex_unlock( &update_size_mutex );
24.412 -
24.413 -#if 0
24.414 -#if ENABLE_TIMING_POSITION == 1
24.415 - guint64 size_tmp = 0;
24.416 - if (src->live_tv == TRUE) {
24.417 - //g_usleep( 1000 );
24.418 -get_file_pos:
24.419 - //g_usleep( 100 );
24.420 - size_tmp = myth_file_transfer_get_file_position( src->file_transfer );
24.421 - if ( size_tmp > ( src->content_size + MYTHTV_TRANSFER_MAX_BUFFER ) )
24.422 - src->content_size = size_tmp;
24.423 - else
24.424 - goto get_file_pos;
24.425 - g_print( "\t[%s]\tGET_POSITION: file_position = %llu\n",
24.426 - __FUNCTION__, size_tmp);
24.427 -
24.428 - }
24.429 -#endif
24.430 -#endif
24.431 -
24.432 - //if (G_UNLIKELY (read < 0))
24.433 - // goto read_error;
24.434 -
24.435 - if (G_UNLIKELY(src->eos))
24.436 - goto eos;
24.437 - else
24.438 - goto done;
24.439 -
24.440 -done:
24.441 - return ret;
24.442 -eos:
24.443 -#if 0
24.444 -#if ENABLE_TIMING_POSITION == 1
24.445 - if ( src->live_tv == TRUE ) {
24.446 - //g_usleep( 1000 );
24.447 - guint64 size_tmp = 0;
24.448 -get_file_pos_eos:
24.449 - //g_usleep( 100 );
24.450 - size_tmp = myth_file_transfer_get_file_position( src->file_transfer );
24.451 - if ( size_tmp > ( src->content_size + MYTHTV_TRANSFER_MAX_BUFFER ) )
24.452 - src->content_size = size_tmp;
24.453 - else
24.454 - goto get_file_pos_eos;
24.455 - g_print( "\t[%s]\tGET_POSITION: file_position = %llu\n",
24.456 - __FUNCTION__, size_tmp);
24.457 - goto done;
24.458 - } else
24.459 -#endif
24.460 -#endif
24.461 - {
24.462 - GST_DEBUG_OBJECT (src, "EOS reached");
24.463 - return GST_FLOW_UNEXPECTED;
24.464 - }
24.465 - /* ERRORS */
24.466 -read_error:
24.467 - {
24.468 - GST_ELEMENT_ERROR (src, RESOURCE, READ,
24.469 - (NULL), ("Could not read any bytes (%i, %s)", read,
24.470 - src->uri_name));
24.471 - return GST_FLOW_ERROR;
24.472 - }
24.473 - #if 0
24.474 -need_pause:
24.475 - {
24.476 - const gchar *reason = gst_flow_get_name (ret);
24.477 -
24.478 - GST_DEBUG_OBJECT (src, "pausing task, reason %s", reason);
24.479 - return GST_FLOW_UNEXPECTED;
24.480 - }
24.481 - #endif
24.482 -
24.483 -}
24.484 -
24.485 -#if 0
24.486 -/* The following two charset mangling functions were copied from gnomevfssrc.
24.487 - * Preserve them under the unverified assumption that they do something vaguely
24.488 - * worthwhile.
24.489 - */
24.490 - static char *
24.491 -unicodify (const char *str, int len, ...)
24.492 -{
24.493 - char *ret = NULL, *cset;
24.494 - va_list args;
24.495 - gsize bytes_read, bytes_written;
24.496 -
24.497 - if (g_utf8_validate (str, len, NULL))
24.498 - return g_strndup (str, len >= 0 ? len : strlen (str));
24.499 -
24.500 - va_start (args, len);
24.501 - while ((cset = va_arg (args, char *)) != NULL)
24.502 - {
24.503 - if (!strcmp (cset, "locale"))
24.504 - ret = g_locale_to_utf8 (str, len, &bytes_read, &bytes_written, NULL);
24.505 - else
24.506 - ret = g_convert (str, len, "UTF-8", cset,
24.507 - &bytes_read, &bytes_written, NULL);
24.508 - if (ret)
24.509 - break;
24.510 - }
24.511 - va_end (args);
24.512 -
24.513 - return ret;
24.514 -}
24.515 -
24.516 - static char *
24.517 -gst_mythtv_src_unicodify (const char *str)
24.518 -{
24.519 - return unicodify (str, -1, "locale", "ISO-8859-1", NULL);
24.520 -}
24.521 -#endif
24.522 -
24.523 -void
24.524 -update_size_func( void *mythtv_data )
24.525 -{
24.526 - GstMythtvSrc *src;
24.527 -
24.528 - g_return_if_fail( mythtv_data != NULL );
24.529 -
24.530 - src = GST_MYTHTV_SRC ( mythtv_data );
24.531 - if ( src->do_start ) {
24.532 - #if ENABLE_TIMING_POSITION == 1
24.533 - guint64 size_tmp = 0;
24.534 - if (src->live_tv == TRUE) {
24.535 -get_file_pos:
24.536 - //g_usleep( 50 );
24.537 - size_tmp = myth_file_transfer_get_file_position( src->file_transfer );
24.538 - if ( size_tmp > ( src->content_size + MYTHTV_TRANSFER_MAX_BUFFER ) )
24.539 - src->content_size = size_tmp;
24.540 - else
24.541 - goto get_file_pos;
24.542 - g_print( "\t[%s]\tGET_POSITION: file_position = %llu\n",
24.543 - __FUNCTION__, size_tmp );
24.544 - }
24.545 -#endif
24.546 -}
24.547 - gst_task_pause( update_size_task );
24.548 - // src->do_start = FALSE;
24.549 - //GST_TASK_SIGNAL( update_size_task );
24.550 -
24.551 -}
24.552 -
24.553 -/* create a socket for connecting to remote server */
24.554 - static gboolean
24.555 -gst_mythtv_src_start ( GstBaseSrc * bsrc )
24.556 -{
24.557 - GstMythtvSrc *src = GST_MYTHTV_SRC (bsrc);
24.558 -
24.559 - GString *chain_id_local = NULL;
24.560 -
24.561 - gboolean ret = TRUE;
24.562 -#if 0
24.563 - if (src->live_tv == TRUE && src->file_transfer != NULL) {
24.564 - guint64 size_tmp = myth_file_transfer_get_file_position( src->file_transfer );
24.565 - if (size_tmp > src->content_size)
24.566 - src->content_size = size_tmp;
24.567 - g_print( "\t[%s]\tGET_POSITION: file_position = %llu\n",
24.568 - __FUNCTION__, size_tmp);
24.569 - }
24.570 -#endif
24.571 - if (src->unique_setup == FALSE) {
24.572 - src->unique_setup = TRUE;
24.573 - } else {
24.574 - goto done;
24.575 - }
24.576 -
24.577 - //GST_OBJECT_LOCK(src);
24.578 -
24.579 - if ( src->live_tv ) {
24.580 - src->spawn_livetv = myth_livetv_new( );
24.581 - if ( myth_livetv_setup( src->spawn_livetv ) == FALSE ) {
24.582 - ret = FALSE;
24.583 - goto init_failed;
24.584 - }
24.585 - /* set up the uri variable */
24.586 - src->uri_name = g_strdup( src->spawn_livetv->proginfo->pathname->str );
24.587 - chain_id_local = gmyth_tvchain_get_id( src->spawn_livetv->tvchain );
24.588 - if ( chain_id_local != NULL ) {
24.589 - src->live_chain_id = g_strdup( chain_id_local->str );
24.590 - g_print( "\t[%s]\tLocal chain ID = %s.\n", __FUNCTION__, src->live_chain_id );
24.591 - }
24.592 - src->live_tv_id = src->spawn_livetv->remote_encoder->recorder_num;
24.593 - g_print ( "[%s] LiveTV id = %d, URI path = %s.\n", __FUNCTION__, src->live_tv_id, src->uri_name );
24.594 - }
24.595 -
24.596 - src->file_transfer = myth_file_transfer_new( src->live_tv_id,
24.597 - g_string_new( src->uri_name ), -1, src->mythtv_version );
24.598 -
24.599 - if ( src->file_transfer == NULL ) {
24.600 - //GST_OBJECT_UNLOCK(src);
24.601 -
24.602 - goto init_failed;
24.603 - }
24.604 -
24.605 - if ( src->live_tv ) {
24.606 - g_print ( "[%s] GST MYTHTVSRC: live_chain_id = %s\n", __FUNCTION__, src->live_chain_id );
24.607 - /* sets the MythSocket to the FileTransfer */
24.608 - //ret = myth_file_transfer_livetv_setup( &(src->file_transfer), src->spawn_livetv->remote_encoder->myth_socket );
24.609 - }
24.610 - /* sets the Playback monitor connection */
24.611 - ret = myth_file_transfer_playback_setup( &(src->file_transfer), src->live_tv );
24.612 -
24.613 - if ( src->live_tv == TRUE && ret == TRUE ) {
24.614 - /* loop finished, set the max tries variable to zero again... */
24.615 - wait_to_transfer = 0;
24.616 -
24.617 - while ( wait_to_transfer++ < MYTHTV_TRANSFER_MAX_WAITS && ( myth_file_transfer_is_recording( src->file_transfer ) == FALSE
24.618 - /*|| ( myth_file_transfer_get_file_position( src->file_transfer ) < ( src->content_size + 327680 ) )*/ ) )
24.619 - g_usleep( 100 );
24.620 - }
24.621 -
24.622 - /* sets the FileTransfer instance connection (video/audio download) */
24.623 - ret = myth_file_transfer_setup( &(src->file_transfer), src->live_tv );
24.624 -
24.625 - if ( ret == FALSE ) {
24.626 - //GST_OBJECT_UNLOCK(src);
24.627 -#ifndef GST_DISABLE_GST_DEBUG
24.628 - if ( src->mythtv_msgs_dbg )
24.629 - g_printerr( "MythTV FileTransfer request failed when setting up socket connection!\n" );
24.630 -#endif
24.631 - goto begin_req_failed;
24.632 - }
24.633 -
24.634 - src->content_size = src->file_transfer->filesize;
24.635 -
24.636 - //GST_OBJECT_UNLOCK(src);
24.637 -
24.638 - update_size_task = gst_task_create( update_size_func, src );
24.639 -
24.640 - gst_task_set_lock( update_size_task, &update_size_mutex );
24.641 -
24.642 - g_print( "[%s] Update Size task = %s\n", __FUNCTION__, gst_task_start( update_size_task ) &&
24.643 - GST_TASK_STATE( update_size_task ) == GST_TASK_STARTED ? "OK !" : "ERROR!!!" );
24.644 -
24.645 - src->do_start = TRUE;
24.646 -
24.647 -#if 0
24.648 - const char *str_value;
24.649 - gint gint_value;
24.650 -
24.651 - str_value = ne_get_response_header (src->request, "myth-metaint");
24.652 - if (str_value) {
24.653 - if ( sscanf (str_value, "%d", &gint_value) == 1 ) {
24.654 - if (src->myth_caps) {
24.655 - gst_caps_unref (src->myth_caps);
24.656 - src->myth_caps = NULL;
24.657 - }
24.658 - src->myth_metaint = gint_value;
24.659 -#endif
24.660 - //src->mythtv_caps = gst_caps_new_simple ("application/x-gst_ff-nuv", NULL);
24.661 - // }
24.662 - // }
24.663 -done:
24.664 - return TRUE;
24.665 -
24.666 - /* ERRORS */
24.667 -init_failed:
24.668 - {
24.669 - if (src->spawn_livetv != NULL )
24.670 - g_object_unref( src->spawn_livetv );
24.671 -
24.672 - GST_ELEMENT_ERROR (src, LIBRARY, INIT,
24.673 - (NULL), ("Could not initialize MythTV library (%i, %s)", ret, src->uri_name));
24.674 - return FALSE;
24.675 - }
24.676 -begin_req_failed:
24.677 - {
24.678 - GST_ELEMENT_ERROR (src, LIBRARY, INIT,
24.679 - (NULL), ("Could not begin request sent to MythTV server (%i, %s)", ret, src->uri_name));
24.680 - return FALSE;
24.681 - }
24.682 -}
24.683 -
24.684 -#if 0
24.685 -static gboolean
24.686 -gst_mythtv_src_get_size (GstBaseSrc * bsrc, guint64 * size)
24.687 -{
24.688 - GstMythtvSrc *src;
24.689 - gboolean ret = FALSE;
24.690 -
24.691 - src = GST_MYTHTV_SRC (bsrc);
24.692 -
24.693 - g_static_rec_mutex_lock( &update_size_mutex );
24.694 - src->do_start = FALSE;
24.695 - g_static_rec_mutex_unlock( &update_size_mutex );
24.696 - GST_TASK_SIGNAL( update_size_task );
24.697 -
24.698 -
24.699 - while (1) {
24.700 -
24.701 - g_static_rec_mutex_lock( &update_size_mutex );
24.702 - if ( !src->do_start ) {
24.703 -
24.704 - g_print( "[%s] GET SIZE: do_start? == %s\n", __FUNCTION__, src->do_start ? "YES" : "NO" );
24.705 -
24.706 - GST_TASK_WAIT( update_size_task );
24.707 - } else {
24.708 - if (src->content_size <= 0) {
24.709 - g_static_rec_mutex_unlock( &update_size_mutex );
24.710 - goto done;
24.711 - }
24.712 -
24.713 - *size = src->content_size;
24.714 - src->do_start = FALSE;
24.715 -
24.716 - g_static_rec_mutex_unlock( &update_size_mutex );
24.717 -
24.718 - break;
24.719 - }
24.720 - g_static_rec_mutex_unlock( &update_size_mutex );
24.721 -
24.722 - } // while (1)
24.723 -
24.724 -done:
24.725 - return ret;
24.726 -
24.727 -}
24.728 -#endif
24.729 -
24.730 -static gboolean
24.731 -gst_mythtv_src_get_size (GstBaseSrc * bsrc, guint64 * size)
24.732 -{
24.733 - GstMythtvSrc *src;
24.734 - gboolean ret = TRUE;
24.735 -
24.736 - src = GST_MYTHTV_SRC (bsrc);
24.737 -
24.738 - if (src->content_size <= 0)
24.739 - ret= FALSE;
24.740 -
24.741 - *size = src->content_size;
24.742 -
24.743 - return ret;
24.744 -
24.745 -}
24.746 -/* close the socket and associated resources
24.747 - * used both to recover from errors and go to NULL state */
24.748 - static gboolean
24.749 -gst_mythtv_src_stop (GstBaseSrc * bsrc)
24.750 -{
24.751 - GstMythtvSrc *src;
24.752 -
24.753 - src = GST_MYTHTV_SRC (bsrc);
24.754 -
24.755 - if (src->uri_name) {
24.756 - g_free (src->uri_name);
24.757 - src->uri_name = NULL;
24.758 - }
24.759 -
24.760 - if (src->mythtv_caps) {
24.761 - gst_caps_unref (src->mythtv_caps);
24.762 - src->mythtv_caps = NULL;
24.763 - }
24.764 -
24.765 - src->eos = FALSE;
24.766 -
24.767 - return TRUE;
24.768 -}
24.769 -
24.770 - static gboolean
24.771 -gst_mythtv_src_handle_event (GstPad * pad, GstEvent * event)
24.772 -{
24.773 - GstMythtvSrc *src = GST_MYTHTV_SRC (GST_PAD_PARENT (pad));
24.774 -
24.775 - switch (GST_EVENT_TYPE (event)) {
24.776 - case GST_EVENT_FLUSH_START:
24.777 - src->eos = FALSE;
24.778 - break;
24.779 - //return TRUE;
24.780 -#if 0
24.781 -case GST_EVENT_FLUSH_STOP:
24.782 - src->do_start = TRUE;
24.783 - src->eos = FALSE;
24.784 - gst_element_set_state (GST_ELEMENT(src), GST_STATE_NULL);
24.785 - //gst_element_set_locked_state (GST_ELEMENT(src), TRUE);
24.786 - break;
24.787 -#endif
24.788 - case GST_EVENT_SEEK:
24.789 - {
24.790 - gdouble rate;
24.791 - //gboolean update = TRUE;
24.792 - GstFormat format;
24.793 - GstSeekType cur_type, stop_type;
24.794 - GstSeekFlags flags;
24.795 - gint64 cur = 0, stop = 0;
24.796 - gst_event_parse_seek ( event, &rate, &format,
24.797 - &flags, &cur_type, &cur,
24.798 - &stop_type, &stop );
24.799 -
24.800 - g_print( "[%s] Got EVENT_SEEK.\n", __FUNCTION__ );
24.801 - if ( !( flags & GST_SEEK_FLAG_FLUSH ) ) {
24.802 - g_print( "[%s] Could get the FLAG_FLUSH message.\n", __FUNCTION__ );
24.803 - }
24.804 - //gboolean ret = gst_event_parse_new_segment ( event,
24.805 - // &update, &rate, &format, &start, &stop,
24.806 - // &position );
24.807 - //GstFlowReturn flow_ret = gst_mythtv_src_create (GST_BASE_SRC( GST_PAD_PARENT( psrc ) ),
24.808 - // cur, stop - cur + 1, GstBuffer)
24.809 -
24.810 - }
24.811 - default:
24.812 - return gst_pad_event_default (pad, event);
24.813 - }
24.814 -
24.815 - return gst_pad_event_default (pad, event);
24.816 -}
24.817 -
24.818 - static gboolean
24.819 -gst_mythtv_src_is_seekable( GstBaseSrc *base_src )
24.820 -{
24.821 - return TRUE;
24.822 -}
24.823 -
24.824 - static void
24.825 -gst_mythtv_src_set_property (GObject * object, guint prop_id,
24.826 - const GValue * value, GParamSpec * pspec)
24.827 -{
24.828 - GstMythtvSrc *mythtvsrc = GST_MYTHTV_SRC (object);
24.829 -
24.830 - GST_OBJECT_LOCK (mythtvsrc);
24.831 - switch (prop_id) {
24.832 - case PROP_URI:
24.833 - case PROP_LOCATION:
24.834 - {
24.835 - if (!g_value_get_string (value)) {
24.836 - GST_WARNING ("location property cannot be NULL");
24.837 - goto done;
24.838 - }
24.839 -
24.840 - if (mythtvsrc->uri_name != NULL) {
24.841 - g_free (mythtvsrc->uri_name);
24.842 - mythtvsrc->uri_name = NULL;
24.843 - }
24.844 - mythtvsrc->uri_name = g_value_dup_string (value);
24.845 -
24.846 - break;
24.847 - }
24.848 -#ifndef GST_DISABLE_GST_DEBUG
24.849 - case PROP_MYTHTV_DBG:
24.850 - {
24.851 - mythtvsrc->mythtv_msgs_dbg = g_value_get_boolean (value);
24.852 - break;
24.853 - }
24.854 -#endif
24.855 - case PROP_MYTHTV_VERSION:
24.856 - {
24.857 - mythtvsrc->mythtv_version = g_value_get_int (value);
24.858 - break;
24.859 - }
24.860 - case PROP_MYTHTV_LIVEID:
24.861 - {
24.862 - mythtvsrc->live_tv_id = g_value_get_int (value);
24.863 - break;
24.864 - }
24.865 - case PROP_MYTHTV_LIVE:
24.866 - {
24.867 - mythtvsrc->live_tv = g_value_get_boolean (value);
24.868 - break;
24.869 - }
24.870 - case PROP_MYTHTV_LIVE_CHAINID:
24.871 - {
24.872 - if (!g_value_get_string (value)) {
24.873 - GST_WARNING ("MythTV Live chainid property cannot be NULL");
24.874 - goto done;
24.875 - }
24.876 -
24.877 - if (mythtvsrc->live_chain_id != NULL) {
24.878 - g_free (mythtvsrc->live_chain_id);
24.879 - mythtvsrc->live_chain_id = NULL;
24.880 - }
24.881 - mythtvsrc->live_chain_id = g_value_dup_string (value);
24.882 -
24.883 - break;
24.884 - }
24.885 -
24.886 - default:
24.887 - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
24.888 - break;
24.889 - }
24.890 - GST_OBJECT_UNLOCK (mythtvsrc);
24.891 -done:
24.892 - return;
24.893 -}
24.894 -
24.895 - static void
24.896 -gst_mythtv_src_get_property (GObject * object, guint prop_id,
24.897 - GValue * value, GParamSpec * pspec)
24.898 -{
24.899 - GstMythtvSrc *mythtvsrc = GST_MYTHTV_SRC (object);
24.900 -
24.901 - GST_OBJECT_LOCK (mythtvsrc);
24.902 - switch (prop_id) {
24.903 - case PROP_URI:
24.904 - case PROP_LOCATION:
24.905 - {
24.906 - gchar *str = g_strdup( "" );
24.907 -
24.908 - if ( mythtvsrc->uri_name == NULL ) {
24.909 - g_free (mythtvsrc->uri_name);
24.910 - mythtvsrc->uri_name = NULL;
24.911 - } else {
24.912 - str = g_strdup( mythtvsrc->uri_name );
24.913 - }
24.914 - g_value_set_string ( value, str );
24.915 - break;
24.916 - }
24.917 -#ifndef GST_DISABLE_GST_DEBUG
24.918 - case PROP_MYTHTV_DBG:
24.919 - g_value_set_boolean ( value, mythtvsrc->mythtv_msgs_dbg );
24.920 - break;
24.921 -#endif
24.922 - case PROP_MYTHTV_VERSION:
24.923 - {
24.924 - g_value_set_int ( value, mythtvsrc->mythtv_version );
24.925 - break;
24.926 - }
24.927 - case PROP_MYTHTV_LIVEID:
24.928 - {
24.929 - g_value_set_int ( value, mythtvsrc->live_tv_id );
24.930 - break;
24.931 - }
24.932 - case PROP_MYTHTV_LIVE:
24.933 - g_value_set_boolean ( value, mythtvsrc->live_tv );
24.934 - break;
24.935 - case PROP_MYTHTV_LIVE_CHAINID:
24.936 - {
24.937 - gchar *str = g_strdup( "" );
24.938 -
24.939 - if ( mythtvsrc->live_chain_id == NULL ) {
24.940 - g_free (mythtvsrc->live_chain_id);
24.941 - mythtvsrc->live_chain_id = NULL;
24.942 - } else {
24.943 - str = g_strdup( mythtvsrc->live_chain_id );
24.944 - }
24.945 - g_value_set_string ( value, str );
24.946 - break;
24.947 - }
24.948 - default:
24.949 - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
24.950 - break;
24.951 - }
24.952 - GST_OBJECT_UNLOCK (mythtvsrc);
24.953 -}
24.954 -
24.955 -/* entry point to initialize the plug-in
24.956 - * initialize the plug-in itself
24.957 - * register the element factories and pad templates
24.958 - * register the features
24.959 - */
24.960 - static gboolean
24.961 -plugin_init (GstPlugin * plugin)
24.962 -{
24.963 - return gst_element_register (plugin, "mythtvsrc", GST_RANK_NONE,
24.964 - GST_TYPE_MYTHTV_SRC);
24.965 -}
24.966 -
24.967 -/* this is the structure that gst-register looks for
24.968 - * so keep the name plugin_desc, or you cannot get your plug-in registered */
24.969 -GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
24.970 - GST_VERSION_MINOR,
24.971 - "mythtv",
24.972 - "lib MythTV src",
24.973 - plugin_init, VERSION, "LGPL", "GStreamer", "http://gstreamer.net/")
24.974 -
24.975 -
24.976 -/*** GSTURIHANDLER INTERFACE *************************************************/
24.977 - static guint
24.978 -gst_mythtv_src_uri_get_type (void)
24.979 -{
24.980 - return GST_URI_SRC;
24.981 -}
24.982 -
24.983 - static gchar **
24.984 -gst_mythtv_src_uri_get_protocols (void)
24.985 -{
24.986 - static gchar *protocols[] = { "myth", "myths", NULL };
24.987 -
24.988 - return protocols;
24.989 -}
24.990 -
24.991 - static const gchar *
24.992 -gst_mythtv_src_uri_get_uri (GstURIHandler * handler)
24.993 -{
24.994 - GstMythtvSrc *src = GST_MYTHTV_SRC (handler);
24.995 -
24.996 - return src->uri_name;
24.997 -}
24.998 -
24.999 - static gboolean
24.1000 -gst_mythtv_src_uri_set_uri (GstURIHandler * handler, const gchar * uri)
24.1001 -{
24.1002 - GstMythtvSrc *src = GST_MYTHTV_SRC (handler);
24.1003 -
24.1004 - gchar *protocol;
24.1005 -
24.1006 - protocol = gst_uri_get_protocol (uri);
24.1007 - if ((strcmp (protocol, "myth") != 0) && (strcmp (protocol, "myths") != 0)) {
24.1008 - g_free (protocol);
24.1009 - return FALSE;
24.1010 - }
24.1011 - g_free (protocol);
24.1012 - g_object_set (src, "location", uri, NULL);
24.1013 -
24.1014 - return TRUE;
24.1015 -}
24.1016 -
24.1017 - static void
24.1018 -gst_mythtv_src_uri_handler_init (gpointer g_iface, gpointer iface_data)
24.1019 -{
24.1020 - GstURIHandlerInterface *iface = (GstURIHandlerInterface *) g_iface;
24.1021 -
24.1022 - iface->get_type = gst_mythtv_src_uri_get_type;
24.1023 - iface->get_protocols = gst_mythtv_src_uri_get_protocols;
24.1024 - iface->get_uri = gst_mythtv_src_uri_get_uri;
24.1025 - iface->set_uri = gst_mythtv_src_uri_set_uri;
24.1026 -}
24.1027 -
24.1028 - void
24.1029 -size_header_handler (void *userdata, const char *value)
24.1030 -{
24.1031 - GstMythtvSrc *src = GST_MYTHTV_SRC (userdata);
24.1032 -
24.1033 - //src->content_size = g_ascii_strtoull (value, NULL, 10);
24.1034 -
24.1035 - GST_DEBUG_OBJECT (src, "content size = %lld bytes", src->content_size);
24.1036 -}
25.1 --- a/gst-plugins-mythtv/src/gstmythtvsrc.h Tue May 01 17:22:20 2007 +0100
25.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
25.3 @@ -1,133 +0,0 @@
25.4 -/* GStreamer
25.5 - * Copyright (C) <2006> Rosfran Borges <rosfran.borges@indt.org.br>
25.6 - *
25.7 - * This library is free software; you can redistribute it and/or
25.8 - * modify it under the terms of the GNU Library General Public
25.9 - * License as published by the Free Software Foundation; either
25.10 - * version 2 of the License, or (at your option) any later version.
25.11 - *
25.12 - * This library is distributed in the hope that it will be useful,
25.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
25.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25.15 - * Library General Public License for more details.
25.16 - *
25.17 - * You should have received a copy of the GNU Library General Public
25.18 - * License along with this library; if not, write to the
25.19 - * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25.20 - * Boston, MA 02111-1307, USA.
25.21 - */
25.22 -
25.23 -#ifndef __GST_MYTHTV_SRC_H__
25.24 -#define __GST_MYTHTV_SRC_H__
25.25 -
25.26 -#include <gst/gst.h>
25.27 -#include <gst/base/gstbasesrc.h>
25.28 -#include <gst/base/gstpushsrc.h>
25.29 -#include <stdio.h>
25.30 -
25.31 -#include <gmyth/gmyth_socket.h>
25.32 -#include <gmyth/gmyth_file.h>
25.33 -#include <gmyth/gmyth_file_transfer.h>
25.34 -#include <gmyth/gmyth_file_local.h>
25.35 -#include <gmyth/gmyth_livetv.h>
25.36 -#include <gmyth/gmyth_backendinfo.h>
25.37 -
25.38 -G_BEGIN_DECLS
25.39 -
25.40 -#define GST_TYPE_MYTHTV_SRC \
25.41 - (gst_mythtv_src_get_type())
25.42 -#define GST_MYTHTV_SRC(obj) \
25.43 - (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MYTHTV_SRC,GstMythtvSrc))
25.44 -#define GST_MYTHTV_SRC_CLASS(klass) \
25.45 - (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MYTHTV_SRC,GstMythtvSrcClass))
25.46 -#define GST_IS_MYTHTV_SRC(obj) \
25.47 - (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MYTHTV_SRC))
25.48 -#define GST_IS_MYTHTV_SRC_CLASS(klass) \
25.49 - (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MYTHTV_SRC))
25.50 -
25.51 -typedef struct _GstMythtvSrc GstMythtvSrc;
25.52 -typedef struct _GstMythtvSrcClass GstMythtvSrcClass;
25.53 -
25.54 -typedef enum {
25.55 - GST_MYTHTV_SRC_FILE_TRANSFER,
25.56 - GST_MYTHTV_SRC_NEXT_PROGRAM_CHAIN,
25.57 - GST_MYTHTV_SRC_INVALID_DATA
25.58 -} GstMythtvState;
25.59 -
25.60 -struct _GstMythtvSrc {
25.61 - GstPushSrc element;
25.62 -
25.63 - /* MythFileTransfer */
25.64 - GMythFile *file;
25.65 -
25.66 - GMythLiveTV *spawn_livetv;
25.67 -
25.68 - GMythBackendInfo *backend_info;
25.69 -
25.70 - GstMythtvState state;
25.71 -
25.72 - gchar *uri_name;
25.73 - gchar *user_agent;
25.74 -
25.75 - gchar *live_chain_id;
25.76 -
25.77 - gint mythtv_version;
25.78 -
25.79 - gint64 content_size;
25.80 -
25.81 - gint64 prev_content_size;
25.82 -
25.83 - gint64 content_size_last;
25.84 -
25.85 - guint64 bytes_read;
25.86 -
25.87 - gint64 read_offset;
25.88 -
25.89 - gint buffer_remain;
25.90 -
25.91 - gboolean eos;
25.92 -
25.93 - gboolean do_start;
25.94 -
25.95 - gboolean unique_setup;
25.96 -
25.97 - gboolean live_tv;
25.98 -
25.99 - gboolean enable_timing_position;
25.100 -
25.101 - gint live_tv_id;
25.102 -
25.103 - gchar* channel_name;
25.104 -
25.105 - guint mode;
25.106 -
25.107 - /* MythTV capabilities */
25.108 - GstCaps *mythtv_caps;
25.109 -
25.110 - GByteArray *bytes_queue;
25.111 -
25.112 -#ifndef GST_DISABLE_GST_DEBUG
25.113 - /* enable Myth TV debug messages */
25.114 - gboolean mythtv_msgs_dbg;
25.115 -#endif
25.116 -
25.117 - gboolean update_prog_chain;
25.118 -
25.119 - /* stablish a maximum iteration value to the IS_RECORDING message */
25.120 - guint wait_to_transfer;
25.121 -
25.122 - /* max try number to get freerecorder */
25.123 - gint max_try;
25.124 - gint try_number;
25.125 -
25.126 -};
25.127 -
25.128 -struct _GstMythtvSrcClass {
25.129 - GstPushSrcClass parent_class;
25.130 -};
25.131 -
25.132 -GType gst_mythtv_src_get_type (void);
25.133 -
25.134 -G_END_DECLS
25.135 -
25.136 -#endif /* __GST_MYTHTV_SRC_H__ */
26.1 --- a/gst-plugins-mythtv/tests/compile-myth-tests.sh Tue May 01 17:22:20 2007 +0100
26.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
26.3 @@ -1,3 +0,0 @@
26.4 -#! /bin/sh
26.5 -gcc `pkg-config --cflags maemo-myth-0.1 gobject-2.0 glib-2.0 gtk+-2.0 gstreamer-base-0.10 gstreamer-0.10 gstreamer-dataprotocol-0.10 gstreamer-plugins-base-0.10 gstreamer-net-0.10` -DDO_TESTING -c myth_file_transfer.c
26.6 -gcc `pkg-config --cflags --libs maemo-myth-0.1 gobject-2.0 glib-2.0 gtk+-2.0 gstreamer-base-0.10 gstreamer-0.10` -DDO_TESTING -o mmyth-tests myth_file_transfer.o
27.1 --- a/gst-plugins-mythtv/tests/mythtvsrc-test.c Tue May 01 17:22:20 2007 +0100
27.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
27.3 @@ -1,85 +0,0 @@
27.4 -#include <gst/gst.h>
27.5 -
27.6 -static gboolean
27.7 -bus_call (GstBus *bus,
27.8 - GstMessage *msg,
27.9 - gpointer data)
27.10 -{
27.11 - GMainLoop *loop = data;
27.12 -
27.13 - switch (GST_MESSAGE_TYPE (msg)) {
27.14 - case GST_MESSAGE_EOS:
27.15 - g_print ("End-of-stream\n");
27.16 - g_main_loop_quit (loop);
27.17 - break;
27.18 - case GST_MESSAGE_ERROR: {
27.19 - gchar *debug;
27.20 - GError *err;
27.21 -
27.22 - gst_message_parse_error (msg, &err, &debug);
27.23 - g_free (debug);
27.24 -
27.25 - g_print ("Error: %s\n", err->message);
27.26 - g_error_free (err);
27.27 -
27.28 - g_main_loop_quit (loop);
27.29 - break;
27.30 - }
27.31 - default:
27.32 - break;
27.33 - }
27.34 -
27.35 - return TRUE;
27.36 -}
27.37 -
27.38 -gint
27.39 -main (gint argc,
27.40 - gchar *argv[])
27.41 -{
27.42 - GstElement *pipeline, *filesrc, *decoder, *filter, *sink;
27.43 - GMainLoop *loop;
27.44 -
27.45 - /* initialization */
27.46 - gst_init (&argc, &argv);
27.47 - loop = g_main_loop_new (NULL, FALSE);
27.48 - if (argc != 2) {
27.49 - g_print ("Usage: %s <myth uri>\n", argv[0]);
27.50 - return 01;
27.51 - }
27.52 -
27.53 - /* create elements */
27.54 - pipeline = gst_pipeline_new ("mythtvsrc_pipeline");
27.55 - gst_bus_add_watch (gst_pipeline_get_bus (GST_PIPELINE (pipeline)),
27.56 - bus_call, loop);
27.57 -
27.58 - filesrc = gst_element_factory_make ("mythtvsrc", "mythtvsrc");
27.59 - decoder = gst_element_factory_make ("mad", "my_decoder");
27.60 - filter = gst_element_factory_make ("my_filter", "my_filter");
27.61 - sink = gst_element_factory_make ("osssink", "audiosink");
27.62 - if (!sink || !decoder) {
27.63 - g_print ("Decoder or output could not be found - check your install\n");
27.64 - return -1;
27.65 - } else if (!filter) {
27.66 - g_print ("Your self-written filter could not be found. Make sure it "
27.67 - "is installed correctly in $(libdir)/gstreamer-0.9/ and that "
27.68 - "you've ran gst-register-0.9 to register it. Check availability "
27.69 - "of the plugin afterwards using \"gst-inspect-0.9 my_filter\"");
27.70 - return -1;
27.71 - }
27.72 -
27.73 - g_object_set (G_OBJECT (filesrc), "location", argv[1], NULL);
27.74 -
27.75 - /* link everything together */
27.76 - gst_element_link_many (filesrc, decoder, filter, sink, NULL);
27.77 - gst_bin_add_many (GST_BIN (pipeline), filesrc, decoder, filter, sink, NULL);
27.78 -
27.79 - /* run */
27.80 - gst_element_set_state (pipeline, GST_STATE_PLAYING);
27.81 - g_main_loop_run (loop);
27.82 -
27.83 - /* clean up */
27.84 - gst_element_set_state (pipeline, GST_STATE_NULL);
27.85 - gst_object_unref (GST_OBJECT (pipeline));
27.86 -
27.87 - return 0;
27.88 -}
28.1 --- a/gst-plugins-mythtv/tests/test-nuv-2.sh Tue May 01 17:22:20 2007 +0100
28.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
28.3 @@ -1,3 +0,0 @@
28.4 -#! /bin/sh
28.5 -echo on
28.6 -gst-launch-0.10 mythtvsrc location=sample1_divx.nuv
29.1 --- a/gst-plugins-mythtv/tests/test-nuv.sh Tue May 01 17:22:20 2007 +0100
29.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
29.3 @@ -1,3 +0,0 @@
29.4 -#! /bin/sh
29.5 -echo on
29.6 -gst-launch-0.10 filesrc location=sample1_divx.nuv ! ffdemux_nuv name=nuvdemux nuvdemux.video_00 ! queue ! ffdec_mpeg4 ! xvimagesink sync=false nuvdemux.audio_00 ! queue ! ffdec_mp3 ! audioconvert ! alsasink sync=false 2>&1