diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a3cce7b2..066adf10 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,18 +10,29 @@ on: - develop jobs: - build: - runs-on: ubuntu-18.04 + autotools: + strategy: + fail-fast: false + matrix: + os: + - ubuntu-18.04 + - ubuntu-20.04 + include: + - os: ubuntu-22.04 + remove-unwind: fix-unwind + + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 + - if: ${{ matrix.remove-unwind }} + run: sudo apt remove libunwind-14-dev - name: Dependecies run: | sudo apt update sudo apt install automake libtool pkg-config libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev - sudo apt install libglib2.0-dev libjson-glib-dev gtk-doc-tools libreadline-dev libncursesw5-dev - sudo apt install libdaemon-dev libjansson-dev python3-pip python3-setuptools libsoup2.4 - + sudo apt install libglib2.0-dev libjson-glib-dev gtk-doc-tools libedit-dev libncursesw5-dev + sudo apt install libdaemon-dev libjansson-dev python3-pip python3-setuptools libsoup2.4-dev - name: Generate run: ./autogen.sh - name: Configure @@ -32,6 +43,53 @@ jobs: run: make check - name: Install run: sudo make install + - name: Check pygstc installation + run: python3 -c "import pygstc" + - name: List Pipelines Verification + run: | + gstd -e + gstd-client list_pipelines + + meson: + strategy: + fail-fast: false + matrix: + os: + - ubuntu-18.04 + - ubuntu-20.04 + include: + - os: ubuntu-22.04 + remove-unwind: fix-unwind + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + - if: ${{ matrix.remove-unwind }} + run: sudo apt remove libunwind-14-dev + - name: Dependecies + run: | + sudo apt update + sudo apt install automake libtool pkg-config libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev + sudo apt install libglib2.0-dev libjson-glib-dev gtk-doc-tools libedit-dev libncursesw5-dev + sudo apt install libdaemon-dev libjansson-dev python3-pip python3-setuptools libsoup2.4-dev + sudo apt install ninja-build python3-wheel + sudo pip3 install meson + + - name: Generate for Ubuntu 18.04 + if: ${{ matrix.os == 'ubuntu-18.04' }} + run: meson --werror build -Dpython.purelibdir=/usr/lib/python3/dist-packages/ + - name: Generate for Ubuntu 20.04 and above + if: ${{ matrix.os != 'ubuntu-18.04' }} + run: meson --werror build -Dpython.install_env=auto + - name: Compile + run: ninja -C build + - name: Checks + run: ninja -C build test + - name: Install + run: sudo ninja -C build install + - name: Check pygstc installation + run: python3 -c "import pygstc" - name: List Pipelines Verification run: | gstd -e diff --git a/.gitignore b/.gitignore index be57e44f..46c1709c 100644 --- a/.gitignore +++ b/.gitignore @@ -34,11 +34,42 @@ gst_client/gst-client-1.0 __pycache__ autoregen.sh +# debian files +*.deb +*.build +*.buildinfo +*.changes +debian/.debhelper/ +debian/autoreconf.after +debian/autoreconf.before +debian/debhelper-build-stamp +debian/files +debian/*.postinst.debhelper +debian/*.postrm.debhelper +debian/*.prerm.debhelper +debian/*.substvars +debian/gstd/ +debian/pygstc/ + +# python build +build/ +.pybuild/ +*egg-info/ + +# Init +init/gstd +init/gstd.service + # Tests tests/gstd/test_gstd_no_create tests/gstd/test_gstd_pipeline_create tests/gstd/test_gstd_state tests/libgstc/c/libgstc* +tests/libgstd/test_libgstd_create +tests/libgstd/test_libgstd_delete +tests/libgstd/test_libgstd_init +tests/libgstd/test_libgstd_read +tests/libgstd/test_libgstd_update # Examples examples/libgstc/simple_pipeline diff --git a/COPYING b/COPYING index d159169d..2365253e 100644 --- a/COPYING +++ b/COPYING @@ -1,221 +1,397 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - Preamble +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: - a) You must cause the modified files to carry prominent notices + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, +identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of +on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. +entire whole, and thus to each and every part regardless of who wrote +it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or -collective works based on the Program. +collective works based on the Library. -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not compelled to copy the source along with the object code. - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are +distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying -the Program or works based on it. +the Library or works based on it. - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to +You are not responsible for enforcing compliance by third parties with this License. - - 7. If, as a consequence of a court judgment or allegation of patent + + 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. +refrain entirely from distribution of the Library. -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is +integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that @@ -226,114 +402,101 @@ impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. - 8. If the distribution and/or use of the Program is restricted in + 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + Copyright (C) - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if +school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. - , 1 April 1989 + , 1 April 1990 Ty Coon, President of Vice -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. +That's all there is to it! diff --git a/autogen.sh b/autogen.sh index c9e8d0c0..c46f545d 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,25 +1,34 @@ #!/bin/sh ## ## GStreamer Daemon - Gst Launch under steroids -## Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) -## -## This program is free software; you can redistribute it and/or -## modify it under the terms of the GNU General Public License -## as published by the Free Software Foundation; either version 2 -## of the License, or (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +## Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) +## +## Redistribution and use in source and binary forms, with or without +## modification, are permitted provided that the following conditions are +## met: +## +## 1. Redistributions of source code must retain the above copyright +## notice, this list of conditions and the following disclaimer. ## -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +## 2. Redistributions in binary form must reproduce the above copyright +## notice, this list of conditions and the following disclaimer in the +## documentation and/or other materials provided with the distribution. +## +## 3. Neither the name of the copyright holder nor the names of its +## contributors may be used to endorse or promote products derived from +## this software without specific prior written permission. ## -# you can either set the environment variables AUTOCONF, AUTOHEADER, AUTOMAKE, -# ACLOCAL, AUTOPOINT and/or LIBTOOLIZE to the right versions, or leave them -# unset and get the defaults +## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +## HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. gtkdocize || exit 1 diff --git a/configure.ac b/configure.ac index 3cdfdde1..ccc5dd0d 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ dnl required version of autoconf AC_PREREQ([2.53]) dnl Gstreamer's daemon package name and version -AC_INIT([gstd],[0.14.0]) +AC_INIT([gstd],[0.15.0]) dnl required version of gstreamer and gst-plugins-base GST_REQUIRED=1.0.0 @@ -22,6 +22,9 @@ LIBD_REQUIRED=0.14 dnl required version of jansson JANSSON_REQUIRED=2.7 +dnl required version of libedit +LIBEDIT_REQUIRED=3.0 + dnl required version of systemd SYSTEMD_REQUIRED=232 @@ -35,6 +38,13 @@ AM_INIT_AUTOMAKE([1.10 subdir-objects]) dnl enable mainainer mode by default AM_MAINTAINER_MODE([enable]) +AC_WARNING([!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!]) +AC_WARNING([Autotools will be deprecated in the next Gstd release! Please migrate to Meson]) +AC_WARNING([!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!]) +AC_MSG_WARN([!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!]) +AC_MSG_WARN([Autotools will be deprecated in the next Gstd release! Please migrate to Meson]) +AC_MSG_WARN([!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!]) + dnl check for tools (compiler etc.) AM_PROG_CC_C_O @@ -133,27 +143,23 @@ PKG_CHECK_MODULES(GJSON, [ dnl check for gtk-doc -m4_ifdef([GTK_DOC_CHECK], [ -GTK_DOC_CHECK([1.14],[--flavour no-tmpl --docdir docs]) -],[ -AM_CONDITIONAL([ENABLE_GTK_DOC], false) -]) +GTK_DOC_CHECK([1.14]) -AX_LIB_READLINE -if test "x$ax_cv_lib_readline" = "xno"; then +PKG_CHECK_MODULES(LIBEDIT, [ + libedit >= $LIBEDIT_REQUIRED + ], [ + AC_SUBST(LIBEDIT_CFLAGS) + AC_SUBST(LIBEDIT_LIBS) + ], [ AC_MSG_ERROR([ - Please install readline development packages. In Debian based - systems you may run: - - readline : "sudo apt-get install libreadline-dev" + Can't find libedit development packages: - Additionally, install one of the following: - - ncurses : "sudo apt-get install libncurses5-dev" - - ncurserw : "sudo apt-get install libncursesw5-dev" + libedit-dev >= $LIBEDIT_REQUIRED + + Please make sure you have the necessary libdedit-dev + development files installed. ]) -else - AC_SUBST(READLINE_CFLAGS, ) - AC_SUBST(READLINE_LIBS, $ax_cv_lib_readline) -fi +]) PKG_CHECK_MODULES(LIBD, [ libdaemon >= $LIBD_REQUIRED @@ -285,6 +291,10 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ ], [ ])], [ AC_MSG_RESULT([no]) ]) +dnl extra flags passed to all modules +AC_SUBST([GSTD_CFLAGS], ["-std=c11 -D_GNU_SOURCE"]) +AC_SUBST([GSTD_LIBS], []) + dnl ======================================================================= dnl Finally, create Makefiles in all directories dnl ======================================================================= diff --git a/debian/changelog b/debian/changelog index 7fc2e48f..1a2848e5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +gstd (0.15.0-1) unstable; urgency=medium + + * Change project license to LGPL2+ + * Support for refcounted pipe control commands + * Add option to disable daemon logs + * Fix support on Ubuntu 22.04 + * Add meson to CI checks + * Improve support on older systems + * Enhancements on Python test driver and installer + * General improvements and fixes + + -- RidgeRun Engineering Mon, 22 Aug 2022 22:00:00 -0600 + gstd (0.14.0-1) unstable; urgency=medium * Add actions diff --git a/debian/control b/debian/control index 79861b69..f4fae330 100644 --- a/debian/control +++ b/debian/control @@ -10,7 +10,7 @@ Build-Depends: debhelper (>= 10), libglib2.0-dev, libjson-glib-dev, gtk-doc-tools, - libreadline-dev, + libedit-dev, libncursesw5-dev, libdaemon-dev, libjansson-dev, @@ -22,19 +22,8 @@ Homepage: https://developer.ridgerun.com/wiki/index.php?title=GStreamer_Daemon_- Package: gstd Architecture: any Multi-arch: same -Depends: ${shlibs:Depends}, ${misc:Depends}, - automake, - libtool, - pkg-config, - libgstreamer1.0-dev, - libgstreamer-plugins-base1.0-dev, - libglib2.0-dev, - libjson-glib-dev, - gtk-doc-tools, - libreadline-dev, - libncursesw5-dev, - libdaemon-dev, - libjansson-dev +Depends: ${shlibs:Depends}, + ${misc:Depends} Description: GStreamer Daemon GStreamer Daemon, also called gstd, is a GStreamer framework for controlling audio and video streaming diff --git a/debian/copyright b/debian/copyright index 87a2f6f1..3ab39d7f 100644 --- a/debian/copyright +++ b/debian/copyright @@ -3,7 +3,7 @@ Upstream-Name: gstd Source: https://www.ridgerun.com/gstd-1.x Files: * -Copyright: 2015-2020, RidgeRun Engineering +Copyright: 2015-2022, RidgeRun Engineering License: LGPL-2+ Copyright: @@ -21,6 +21,40 @@ Copyright: You should have received a copy of the GNU Lesser General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + On Debian GNU/Linux systems, the complete text of the GNU Lesser General + Public License can be found in `/usr/share/common-licenses/LGPL'. -On Debian GNU/Linux systems, the complete text of the GNU Lesser General -Public License can be found in `/usr/share/common-licenses/LGPL'. +Files: libgstc/* +Copyright: 2015-2022, RidgeRun Engineering +License: BSD-3-Clause + +Copyright: + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + \ No newline at end of file diff --git a/docs/reference/gstd/Makefile.am b/docs/reference/gstd/Makefile.am index 62870da9..75e41cc9 100644 --- a/docs/reference/gstd/Makefile.am +++ b/docs/reference/gstd/Makefile.am @@ -62,11 +62,11 @@ expand_content_files= # e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) GTKDOC_CFLAGS=$(GST_CFLAGS) $(GIO_CFLAGS) -I$(top_srcdir)/gstd/ -GTKDOC_LIBS=$(top_builddir)/gstd/libgstd-core.la +GTKDOC_LIBS=$(top_builddir)/libgstd/libgstd-$(GSTD_API_VERSION).la # This includes the standard gtk-doc make rules, copied by gtkdocize. -include $(top_builddir)/docs/gtk-doc.make +include $(top_srcdir)/gtk-doc.make # Comment this out if you want 'make check' to test you doc status # and run some sanity checks diff --git a/docs/reference/gstd/gstd-docs.xml b/docs/reference/gstd/gstd-docs.xml index 97806b71..334a213d 100644 --- a/docs/reference/gstd/gstd-docs.xml +++ b/docs/reference/gstd/gstd-docs.xml @@ -1,22 +1,35 @@ + -- This file is part of GStreamer Daemon + -- Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + -- + -- Redistribution and use in source and binary forms, with or without + -- modification, are permitted provided that the following conditions are + -- met: + -- + -- 1. Redistributions of source code must retain the above copyright + -- notice, this list of conditions and the following disclaimer. + -- + -- 2. Redistributions in binary form must reproduce the above copyright + -- notice, this list of conditions and the following disclaimer in the + -- documentation and/or other materials provided with the distribution. + -- + -- 3. Neither the name of the copyright holder nor the names of its + -- contributors may be used to endorse or promote products derived from + -- this software without specific prior written permission. + -- + -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + --> diff --git a/examples/libgstc/gapless_playback.c b/examples/libgstc/gapless_playback.c index 7af84f58..79bf6380 100644 --- a/examples/libgstc/gapless_playback.c +++ b/examples/libgstc/gapless_playback.c @@ -1,36 +1,23 @@ /* - * GStreamer Daemon - gst-launch on steroids - * C client library abstracting gstd interprocess communication + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * Copyright (c) 2015-2018 RidgeRun, LLC (http://www.ridgerun.com) + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ -#define _GNU_SOURCE #include #include #include @@ -149,7 +136,7 @@ main (int argc, char *argv[]) } free_resources: - free(pipe_description); + free (pipe_description); free_client: gstc_client_free (client); diff --git a/examples/libgstc/mp4_recording.c b/examples/libgstc/mp4_recording.c index ee106473..dc5b1288 100644 --- a/examples/libgstc/mp4_recording.c +++ b/examples/libgstc/mp4_recording.c @@ -1,33 +1,21 @@ /* - * GStreamer Daemon - gst-launch on steroids - * C client library abstracting gstd interprocess communication + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * Copyright (c) 2015-2018 RidgeRun, LLC (http://www.ridgerun.com) + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include diff --git a/examples/libgstc/simple_pipeline.c b/examples/libgstc/simple_pipeline.c index b9ae364d..937b18c0 100644 --- a/examples/libgstc/simple_pipeline.c +++ b/examples/libgstc/simple_pipeline.c @@ -1,33 +1,21 @@ /* - * GStreamer Daemon - gst-launch on steroids - * C client library abstracting gstd interprocess communication + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * Copyright (c) 2015-2018 RidgeRun, LLC (http://www.ridgerun.com) + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include @@ -74,7 +62,7 @@ main (int argc, char *argv[]) fprintf (stderr, "Unable to play pipeline: %d\n", ret); goto free_client; } - + printf ("Press any enter to stop pipeline...\n"); getchar (); @@ -85,7 +73,7 @@ main (int argc, char *argv[]) fprintf (stderr, "Unable to stop pipeline: %d\n", ret); goto free_client; } - + ret = gstc_pipeline_delete (client, "pipe"); if (GSTC_OK == ret) { printf ("Pipeline deleted!\n"); @@ -93,10 +81,10 @@ main (int argc, char *argv[]) fprintf (stderr, "Unable to delete ipeline: %d\n", ret); goto free_client; } - - free_client: + +free_client: gstc_client_free (client); - out: +out: return ret; } diff --git a/gst_client/Makefile.am b/gst_client/Makefile.am index 69bd5b83..7f859801 100644 --- a/gst_client/Makefile.am +++ b/gst_client/Makefile.am @@ -1,8 +1,22 @@ bin_PROGRAMS = gst-client-@GSTD_API_VERSION@ gst_client_@GSTD_API_VERSION@_SOURCES = gst_client.c -gst_client_@GSTD_API_VERSION@_CFLAGS = $(GST_CFLAGS) $(GIO_CFLAGS) $(GIO_UNIX_CFLAGS) $(GJSON_CFLAGS) $(READLINE_CFLAGS) -DGSTD_RUN_STATE_DIR=\"$(GSTD_RUN_STATE_DIR)\" -gst_client_@GSTD_API_VERSION@_LDFLAGS = $(GST_LIBS) $(GIO_LIBS) $(GIO_UNIX_LIBS) $(GJSON_LIBS) $(READLINE_LIBS) +gst_client_@GSTD_API_VERSION@_CFLAGS = \ + $(GSTD_CFLAGS) \ + $(GST_CFLAGS) \ + $(GIO_CFLAGS) \ + $(GIO_UNIX_CFLAGS) \ + $(GJSON_CFLAGS) \ + $(LIBEDIT_CFLAGS) \ + -DGSTD_RUN_STATE_DIR=\"$(GSTD_RUN_STATE_DIR)\" + +gst_client_@GSTD_API_VERSION@_LDFLAGS = \ + $(GSTD_LIBS) \ + $(GST_LIBS) \ + $(GIO_LIBS) \ + $(GIO_UNIX_LIBS) \ + $(GJSON_LIBS) \ + $(LIBEDIT_LIBS) install-exec-hook: $(RM) $(DESTDIR)$(bindir)/gstd-client $(DESTDIR)$(bindir)/gst-client diff --git a/gst_client/gst_client.c b/gst_client/gst_client.c index 202b4216..6bf9699f 100644 --- a/gst_client/gst_client.c +++ b/gst_client/gst_client.c @@ -1,26 +1,28 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2020 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include +#include #include #include #include @@ -31,33 +33,6 @@ #include #include -#ifdef HAVE_LIBREADLINE -# if defined(HAVE_READLINE_READLINE_H) -# include -# elif defined(HAVE_READLINE_H) -# include -# else /* !defined(HAVE_READLINE_H) */ -extern gchar *readline (); -# endif /* !defined(HAVE_READLINE_H) */ -gchar *cmdline = NULL; -#else /* !defined(HAVE_READLINE_READLINE_H) */ - -#endif /* HAVE_LIBREADLINE */ - -#ifdef HAVE_READLINE_HISTORY -# if defined(HAVE_READLINE_HISTORY_H) -# include -# elif defined(HAVE_HISTORY_H) -# include -# else /* !defined(HAVE_HISTORY_H) */ -extern void add_history (); -extern gint write_history (); -extern gint read_history (); -# endif /* defined(HAVE_READLINE_HISTORY_H) */ -#else - -#endif /* HAVE_READLINE_HISTORY */ - /* cmdline defaults */ #define GSTD_CLIENT_DEFAULT_TCP_INET_ADDRESS "localhost" #define GSTD_CLIENT_DEFAULT_UNIX_BASE_NAME "gstd_unix_socket" @@ -126,7 +101,7 @@ static GstdClientCmd cmds[] = { "update [property value ...]"}, {"delete", gstd_client_cmd_socket, "Deletes the resource held at the given URI with the given name", - "read "}, + "delete "}, {"sh", gstd_client_cmd_sh, "Executes a shell command", "sh "}, {"source", gstd_client_cmd_source, "Sources a file with commands", "source "}, @@ -135,15 +110,27 @@ static GstdClientCmd cmds[] = { {"pipeline_create", gstd_client_cmd_socket, "Creates a new pipeline based on the name and description", "pipeline_create "}, + {"pipeline_create_ref", gstd_client_cmd_socket, + "Creates a new pipeline based on the name and description using refcount", + "pipeline_create_ref "}, {"pipeline_delete", gstd_client_cmd_socket, "Deletes the pipeline with the given name", "pipeline_delete "}, + {"pipeline_delete_ref", gstd_client_cmd_socket, + "Deletes the pipeline with the given name using refcount", + "pipeline_delete_ref "}, {"pipeline_play", gstd_client_cmd_socket, "Sets the pipeline to playing", "pipeline_play "}, + {"pipeline_play_ref", gstd_client_cmd_socket, + "Sets the pipeline to playing using refcount", + "pipeline_play_ref "}, {"pipeline_pause", gstd_client_cmd_socket, "Sets the pipeline to paused", "pipeline_pause "}, {"pipeline_stop", gstd_client_cmd_socket, "Sets the pipeline to null", "pipeline_stop "}, + {"pipeline_stop_ref", gstd_client_cmd_socket, + "Sets the pipeline to null using refcount", + "pipeline_stop_ref "}, {"pipeline_get_graph", gstd_client_cmd_socket, "Gets pipeline graph", "pipeline_get_graph "}, {"pipeline_verbose", gstd_client_cmd_socket, "Updates pipeline verbose", @@ -163,17 +150,17 @@ static GstdClientCmd cmds[] = { "list_elements "}, {"list_properties", gstd_client_cmd_socket, "List the properties of an element in a given pipeline", - "list_properties "}, + "list_properties "}, {"list_signals", gstd_client_cmd_socket, "List the signals of an element in a given pipeline", - "list_signals "}, + "list_signals "}, - {"bus_read", gstd_client_cmd_socket, "List the existing pipelines", + {"bus_read", gstd_client_cmd_socket, "Read from the bus", "bus_read "}, {"bus_filter", gstd_client_cmd_socket, "Select the types of message to be read from the bus. Separate with " "a '+', i.e.: eos+warning+error", - "bus_read "}, + "bus_filter "}, {"bus_timeout", gstd_client_cmd_socket, "Apply a timeout for the bus polling. -1: forever, 0: return immediately, " "n: wait n nanoseconds", @@ -235,7 +222,7 @@ static void init_readline (void) { /* Allow conditional parsing of the ~/.inputrc file */ - rl_readline_name = "Gstd"; + rl_readline_name = g_strdup ("Gstd"); /* Custom command completion */ rl_completion_entry_function = gstd_client_completer; @@ -429,11 +416,6 @@ main (gint argc, gchar * argv[]) if (!inter) return EXIT_SUCCESS; -#ifndef HAVE_LIBREADLINE - // No readline, no interaction - quit = TRUE; -#endif - gstd_client_header (quiet); /* New interrupt checkpoint */ @@ -504,7 +486,7 @@ static void gstd_client_header (gboolean quiet) { const gchar *header = - "GStreamer Daemon Copyright (C) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com)\n" + "GStreamer Daemon Copyright (C) 2015-2022 Ridgerun, LLC (http://www.ridgerun.com)\n" "This program comes with ABSOLUTELY NO WARRANTY; for details type `warranty'.\n" "This is free software, and you are welcome to redistribute it\n" "under certain conditions; read the license for more details.\n"; @@ -516,22 +498,24 @@ gstd_client_header (gboolean quiet) static gint gstd_client_cmd_warranty (gchar * name, gchar * arg, GstdClientData * data) { - const gchar *warranty = "GStreamer Daemon - Gst Launch under steroids\n" - "Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com)\n" + const gchar *warranty = "" + "Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com)\n" "\n" - "This program is free software: you can redistribute it and/or\n" - "modify it under the terms of the GNU General Public License\n" - " as published by the Free Software Foundation, either version 2\n" - " of the License, or (at your option) any later version.\n" + "This library is free software; you can redistribute it and/or\n" + "modify it under the terms of the GNU Library General Public\n" + "License as published by the Free Software Foundation; either\n" + "version 2 of the License, or (at your option) any later version.\n" "\n" - "This program is distributed in the hope that it will be useful,\n" + "This library is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" - "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" - "GNU General Public License for more details.\n" + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n" + "Library General Public License for more details.\n" "\n" - "You should have received a copy of the GNU General Public License\n" - "along with this program; if not, write to the Free Software\n" - "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA\n"; + "You should have received a copy of the GNU Library General Public\n" + "License along with this library; if not, write to the\n" + "Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,\n" + "Boston, MA 02110-1301, USA.\n"; + g_print ("%s", warranty); return 0; } diff --git a/gstd/Makefile.am b/gstd/Makefile.am index 61b7637e..e3d31d1c 100644 --- a/gstd/Makefile.am +++ b/gstd/Makefile.am @@ -3,15 +3,18 @@ bin_PROGRAMS = gstd gstd_SOURCES = gstd.c gstd_daemon.c -gstd_CFLAGS = \ - $(GST_CFLAGS) \ - -I$(top_srcdir)/libgstd/ \ - $(LIBD_CFLAGS) \ - -DGSTD_LOG_STATE_DIR=\"$(GSTD_LOG_STATE_DIR)\" \ - -DGSTD_RUN_STATE_DIR=\"$(GSTD_RUN_STATE_DIR)\" +gstd_CFLAGS = \ + $(GSTD_CFLAGS) \ + $(GST_CFLAGS) \ + -I$(top_srcdir)/libgstd/ \ + $(LIBD_CFLAGS) \ + -DGSTD_LOG_STATE_DIR=\"$(GSTD_LOG_STATE_DIR)\" \ + -DGSTD_RUN_STATE_DIR=\"$(GSTD_RUN_STATE_DIR)\" -gstd_LDFLAGS = $(GST_LIBS) \ - $(LIBD_LIBS) \ +gstd_LDFLAGS = \ + $(GSTD_LIBS) \ + $(GST_LIBS) \ + $(LIBD_LIBS) \ -Wl,-rpath -Wl,$(libdir) gstd_LDADD = $(top_builddir)/libgstd/libgstd-1.0.la diff --git a/gstd/gstd.c b/gstd/gstd.c index 27b6bbe8..026a3d7e 100644 --- a/gstd/gstd.c +++ b/gstd/gstd.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2021 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H @@ -74,6 +75,7 @@ main (gint argc, gchar * argv[]) gint ret = EXIT_SUCCESS; gchar *current_filename = NULL; gchar *filename = NULL; + gboolean nolog = FALSE; gboolean parent = FALSE; GstD *gstd = NULL; @@ -100,6 +102,10 @@ main (gint argc, gchar * argv[]) {"gst-log-filename", 'd', 0, G_OPTION_ARG_FILENAME, &gstlogfile, "Create gst.log file to path", NULL} , + {"no-log", 'L', 0, G_OPTION_ARG_NONE, &nolog, + "Disable file logging when gstd is running in daemon mode. Takes precedence over -l and -d.", + NULL} + , {NULL} }; @@ -127,10 +133,20 @@ main (gint argc, gchar * argv[]) goto out; } + /* If we need to daemonize or interact with the daemon (like killing + * it, for example) we need to initialize the daemon subsystem. + */ if (daemon || kill) { - if (!gstd_log_init (gstdlogfile, gstlogfile)) { - ret = EXIT_FAILURE; - goto out; + + /* Initialize the file logging only if: + * - the user didn't explicitly request it by setting --no-log + * - the user didn't invoke gstd to kill the daemon + */ + if (!nolog && !kill) { + if (!gstd_log_init (gstdlogfile, gstlogfile)) { + ret = EXIT_FAILURE; + goto out; + } } if (!gstd_daemon_init (argc, argv, pidfile)) { @@ -157,7 +173,11 @@ main (gint argc, gchar * argv[]) if (parent) { if (!quiet) { filename = gstd_log_get_current_gstd (); - g_print ("Log traces will be saved to %s.\n", filename); + if (nolog) { + g_print ("Log traces have been disabled.\n"); + } else { + g_print ("Log traces will be saved to %s.\n", filename); + } g_print ("Detaching from parent process.\n"); g_free (filename); } diff --git a/gstd/gstd_chmod.sh b/gstd/gstd_chmod.sh index 8e58bce0..fa7fa804 100755 --- a/gstd/gstd_chmod.sh +++ b/gstd/gstd_chmod.sh @@ -3,4 +3,4 @@ # $1 mode # $2 file -chmod $1 $2 +chmod $1 ${DESTDIR}/$2 diff --git a/gstd/gstd_daemon.c b/gstd/gstd_daemon.c index c8b983d0..4a0c61bf 100644 --- a/gstd/gstd_daemon.c +++ b/gstd/gstd_daemon.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ /* Code based on testd.c found in @@ -69,7 +70,8 @@ gstd_daemon_init (gint argc, gchar * argv[], gchar * pidfilename) } if (g_access (pid_path, W_OK)) { - g_printerr ("Unable to open Gstd pid dir %s: %s\n", pid_path, g_strerror (errno)); + g_printerr ("Unable to open Gstd pid dir %s: %s\n", pid_path, + g_strerror (errno)); ret = FALSE; goto free_path; } @@ -93,9 +95,9 @@ gstd_daemon_init (gint argc, gchar * argv[], gchar * pidfilename) _initialized = TRUE; free_path: - g_free (pid_path); + g_free (pid_path); out: - return ret; + return ret; } gboolean diff --git a/gstd/gstd_daemon.h b/gstd/gstd_daemon.h index 277b89a5..6dacaca5 100644 --- a/gstd/gstd_daemon.h +++ b/gstd/gstd_daemon.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_DAEMON_H__ #define __GSTD_DAEMON_H__ diff --git a/gstd/meson.build b/gstd/meson.build index a0a8a65c..b6aa588b 100644 --- a/gstd/meson.build +++ b/gstd/meson.build @@ -18,6 +18,7 @@ executable(exe_name, include_directories : [configinc, libgstd_inc_dir], dependencies : [gstd_deps, lib_gstd_dep], c_args: gst_c_args, + install_rpath: get_option('prefix') + '/' + get_option('libdir'), ) lib_gstd_dir = meson.current_build_dir() diff --git a/libgstc/c/Makefile.am b/libgstc/c/Makefile.am index d410867b..f3684f20 100644 --- a/libgstc/c/Makefile.am +++ b/libgstc/c/Makefile.am @@ -4,18 +4,24 @@ gstdincludedir = $(includedir)/gstd gstdinclude_HEADERS = libgstc.h libgstc_@GSTD_API_VERSION@_la_SOURCES = \ - libgstc.c \ - libgstc_socket.c \ - libgstc_assert.c \ - libgstc_json.c \ + libgstc.c \ + libgstc_socket.c \ + libgstc_assert.c \ + libgstc_json.c \ libgstc_thread.c -libgstc_@GSTD_API_VERSION@_la_CFLAGS = $(JANSSON_CFLAGS) -pthread -libgstc_@GSTD_API_VERSION@_la_LDFLAGS = $(JANSSON_LIBS) -pthread +libgstc_@GSTD_API_VERSION@_la_CFLAGS = \ + $(GSTD_CFLAGS) \ + $(JANSSON_CFLAGS) \ + -pthread -noinst_HEADERS = \ - libgstc_socket.h \ - libgstc_assert.h \ - libgstc_json.h \ - libgstc_thread.h +libgstc_@GSTD_API_VERSION@_la_LDFLAGS = \ + $(GSTD_LIBS) \ + $(JANSSON_LIBS) \ + -pthread +noinst_HEADERS = \ + libgstc_socket.h \ + libgstc_assert.h \ + libgstc_json.h \ + libgstc_thread.h diff --git a/libgstc/c/libgstc.c b/libgstc/c/libgstc.c index 774139f5..75c1ae3c 100644 --- a/libgstc/c/libgstc.c +++ b/libgstc/c/libgstc.c @@ -1,36 +1,39 @@ /* - * GStreamer Daemon - gst-launch on steroids - * C client library abstracting gstd interprocess communication - * - * Copyright (c) 2015-2021 RidgeRun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * modification, are permitted provided that the following conditions are + * met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define _GNU_SOURCE +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include @@ -51,6 +54,12 @@ #define UPDATE_FORMAT "update %s %s" #define DELETE_FORMAT "delete %s %s" +/* Gst client high level command formats */ +#define PIPELINE_CREATE_REF_FORMAT "pipeline_crete_ref %s %s" +#define PIPELINE_DELETE_REF_FORMAT "pipeline_delete_ref %s" +#define PIPELINE_PLAY_REF_FORMAT "pipeline_play_ref %s" +#define PIPELINE_STOP_REF_FORMAT "pipeline_stop_ref %s" + #define PIPELINE_CREATE_FORMAT "%s %s" #define PIPELINE_STATE_FORMAT "/pipelines/%s/state" #define PIPELINE_GRAPH_FORMAT "/pipelines/%s/graph" @@ -328,6 +337,32 @@ gstc_pipeline_create (GstClient * client, const char *pipeline_name, return ret; } +GstcStatus +gstc_pipeline_create_ref (GstClient * client, const char *pipeline_name, + const char *pipeline_desc) +{ + GstcStatus ret; + int asprintf_ret; + char *request; + + gstc_assert_and_ret_val (NULL != client, GSTC_NULL_ARGUMENT); + gstc_assert_and_ret_val (NULL != pipeline_name, GSTC_NULL_ARGUMENT); + gstc_assert_and_ret_val (NULL != pipeline_desc, GSTC_NULL_ARGUMENT); + + asprintf_ret = + asprintf (&request, PIPELINE_CREATE_REF_FORMAT, pipeline_name, + pipeline_desc); + if (PRINTF_ERROR == asprintf_ret) { + return GSTC_OOM; + } + + ret = gstc_cmd_send (client, request); + + free (request); + + return ret; +} + GstcStatus gstc_pipeline_delete (GstClient * client, const char *pipeline_name) { @@ -342,6 +377,28 @@ gstc_pipeline_delete (GstClient * client, const char *pipeline_name) return ret; } +GstcStatus +gstc_pipeline_delete_ref (GstClient * client, const char *pipeline_name) +{ + GstcStatus ret; + int asprintf_ret; + char *request; + + gstc_assert_and_ret_val (NULL != client, GSTC_NULL_ARGUMENT); + gstc_assert_and_ret_val (NULL != pipeline_name, GSTC_NULL_ARGUMENT); + + asprintf_ret = asprintf (&request, PIPELINE_DELETE_REF_FORMAT, pipeline_name); + if (PRINTF_ERROR == asprintf_ret) { + return GSTC_OOM; + } + + ret = gstc_cmd_send (client, request); + + free (request); + + return ret; +} + static GstcStatus gstc_cmd_change_state (GstClient * client, const char *pipe, const char *state) { @@ -376,6 +433,28 @@ gstc_pipeline_play (GstClient * client, const char *pipeline_name) return gstc_cmd_change_state (client, pipeline_name, state); } +GstcStatus +gstc_pipeline_play_ref (GstClient * client, const char *pipeline_name) +{ + GstcStatus ret; + int asprintf_ret; + char *request; + + gstc_assert_and_ret_val (NULL != client, GSTC_NULL_ARGUMENT); + gstc_assert_and_ret_val (NULL != pipeline_name, GSTC_NULL_ARGUMENT); + + asprintf_ret = asprintf (&request, PIPELINE_PLAY_REF_FORMAT, pipeline_name); + if (PRINTF_ERROR == asprintf_ret) { + return GSTC_OOM; + } + + ret = gstc_cmd_send (client, request); + + free (request); + + return ret; +} + GstcStatus gstc_pipeline_pause (GstClient * client, const char *pipeline_name) { @@ -398,6 +477,28 @@ gstc_pipeline_stop (GstClient * client, const char *pipeline_name) return gstc_cmd_change_state (client, pipeline_name, state); } +GstcStatus +gstc_pipeline_stop_ref (GstClient * client, const char *pipeline_name) +{ + GstcStatus ret; + int asprintf_ret; + char *request; + + gstc_assert_and_ret_val (NULL != client, GSTC_NULL_ARGUMENT); + gstc_assert_and_ret_val (NULL != pipeline_name, GSTC_NULL_ARGUMENT); + + asprintf_ret = asprintf (&request, PIPELINE_STOP_REF_FORMAT, pipeline_name); + if (PRINTF_ERROR == asprintf_ret) { + return GSTC_OOM; + } + + ret = gstc_cmd_send (client, request); + + free (request); + + return ret; +} + GstcStatus gstc_pipeline_get_graph (GstClient * client, const char *pipeline_name, char **response) @@ -934,8 +1035,6 @@ gstc_pipeline_bus_wait_callback (GstClient * _client, const char *pipeline_name, return GSTC_OK; } -#pragma GCC diagnostic pop - GstcStatus gstc_pipeline_bus_wait (GstClient * client, const char *pipeline_name, const char *message_name, @@ -996,9 +1095,9 @@ gstc_pipeline_emit_action (GstClient * client, const char *pipeline_name, GstcStatus ret; int asprintf_ret; char *where; - const char *where_fmt = "/pipelines/%s/elements/%s/actions/%s"; - asprintf_ret = asprintf (&where, where_fmt, pipeline_name, element, action); + asprintf_ret = asprintf (&where, "/pipelines/%s/elements/%s/actions/%s", + pipeline_name, element, action); if (asprintf_ret == PRINTF_ERROR) { return GSTC_OOM; } diff --git a/libgstc/c/libgstc.h b/libgstc/c/libgstc.h index da91aace..1f28da9b 100644 --- a/libgstc/c/libgstc.h +++ b/libgstc/c/libgstc.h @@ -1,8 +1,6 @@ /* - * GStreamer Daemon - gst-launch on steroids - * C client library abstracting gstd interprocess communication - * - * Copyright (c) 2015-2021 RidgeRun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -11,23 +9,25 @@ * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** @@ -206,7 +206,22 @@ GstcStatus gstc_client_debug (GstClient *client, const char* threshold, GstcStatus gstc_pipeline_create (GstClient *client, const char *pipeline_name, const char *pipeline_desc); - + +/** + * gstc_pipeline_create_ref: + * @client: The client returned by gstc_client_new() + * @pipeline_name: Name to associate to the pipeline + * @pipeline_desc: The gst-launch style pipeline description to create + * + * Creates a new GStreamer pipeline using refcount. + * + * Returns: GstcStatus indicating success, daemon unreachable, daemon + * timeout, bad pipeline + */ +GstcStatus +gstc_pipeline_create_ref (GstClient *client, const char *pipeline_name, + const char *pipeline_desc); + /** * gstc_pipeline_list: * @client: The client returned by gstc_client_new() @@ -238,6 +253,19 @@ GstcStatus gstc_pipeline_list(GstClient *client, char **pipelines[], GstcStatus gstc_pipeline_delete(GstClient *client, const char *pipeline_name); +/** + * gstc_pipeline_delete_ref: + * @client: The client returned by gstc_client_new() + * @pipeline_name: Name associated with the pipeline + * + * Deletes a previously created GStreamer pipeline using refcount. + * + * Returns: GstcStatus indicating success, daemon unreachable, daemon + * timeout, bad pipeline name + */ +GstcStatus +gstc_pipeline_delete_ref(GstClient *client, const char *pipeline_name); + /** * gstc_pipeline_play: * @client: The client returned by gstc_client_new() @@ -251,6 +279,19 @@ gstc_pipeline_delete(GstClient *client, const char *pipeline_name); GstcStatus gstc_pipeline_play(GstClient *client, const char *pipeline_name); +/** + * gstc_pipeline_play_ref: + * @client: The client returned by gstc_client_new() + * @pipeline_name: Name associated with the pipeline + * + * Attempts to change the named pipeline to the play state using refcount. + * + * Returns: GstcStatus indicating success, daemon unreachable, daemon + * timeout, bad pipeline name, unable to change pipeline state + */ +GstcStatus +gstc_pipeline_play_ref(GstClient *client, const char *pipeline_name); + /** * gstc_pipeline_pause: * @client: The client returned by gstc_client_new() @@ -277,6 +318,19 @@ gstc_pipeline_pause(GstClient *client, const char *pipeline_name); GstcStatus gstc_pipeline_stop(GstClient *client, const char *pipeline_name); +/** + * gstc_pipeline_stop_ref: + * @client: The client returned by gstc_client_new() + * @pipeline_name: Name associated with the pipeline + * + * Attempts to change the named pipeline to the null state using refcount. + * + * Returns: GstcStatus indicating success, daemon unreachable, daemon + * timeout, bad pipeline name, unable to change pipeline state + */ +GstcStatus +gstc_pipeline_stop_ref(GstClient *client, const char *pipeline_name); + /** * gstc_pipeline_get_graph: * @client: The client returned by gstc_client_new() diff --git a/libgstc/c/libgstc_assert.c b/libgstc/c/libgstc_assert.c index 1461b30f..1a36ad92 100644 --- a/libgstc/c/libgstc_assert.c +++ b/libgstc/c/libgstc_assert.c @@ -1,33 +1,33 @@ /* - * GStreamer Daemon - gst-launch on steroids - * C client library abstracting gstd interprocess communication - * - * Copyright (c) 2015-2018 RidgeRun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * modification, are permitted provided that the following conditions are + * met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include diff --git a/libgstc/c/libgstc_assert.h b/libgstc/c/libgstc_assert.h index 37dc0705..1507fc07 100644 --- a/libgstc/c/libgstc_assert.h +++ b/libgstc/c/libgstc_assert.h @@ -1,33 +1,33 @@ /* - * GStreamer Daemon - gst-launch on steroids - * C client library abstracting gstd interprocess communication - * - * Copyright (c) 2015-2018 RidgeRun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * modification, are permitted provided that the following conditions are + * met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __LIBGSTC_ASSERT_H__ diff --git a/libgstc/c/libgstc_json.c b/libgstc/c/libgstc_json.c index fc408305..785427fb 100644 --- a/libgstc/c/libgstc_json.c +++ b/libgstc/c/libgstc_json.c @@ -1,33 +1,33 @@ /* - * GStreamer Daemon - gst-launch on steroids - * C client library abstracting gstd interprocess communication - * - * Copyright (c) 2015-2018 RidgeRun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * modification, are permitted provided that the following conditions are + * met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include @@ -184,7 +184,7 @@ gstc_json_get_child_char_array (const char *json, const char *parent_name, * memory copies are necessary in order to preserve data */ (*out)[i] = malloc (strlen (string) + 1); - strncpy ((*out)[i], string, strlen (string)); + memcpy ((*out)[i], string, strlen (string)); /* Ensure traling null byte is copied */ (*out)[i][strlen (string)] = '\0'; } @@ -239,7 +239,7 @@ gstc_json_child_string (const char *json, const char *parent_name, tmp_string = json_string_value (data); /* Allocate memory for output */ *out = malloc ((strlen (tmp_string) + 1) * sizeof (char)); - strncpy (*out, tmp_string, strlen (tmp_string)); + memcpy (*out, tmp_string, strlen (tmp_string)); /* Ensure traling null byte is copied */ (*out)[strlen (tmp_string)] = '\0'; ret = GSTC_OK; diff --git a/libgstc/c/libgstc_json.h b/libgstc/c/libgstc_json.h index ca9d3657..e57dcc1e 100644 --- a/libgstc/c/libgstc_json.h +++ b/libgstc/c/libgstc_json.h @@ -1,33 +1,33 @@ /* - * GStreamer Daemon - gst-launch on steroids - * C client library abstracting gstd interprocess communication - * - * Copyright (c) 2015-2018 RidgeRun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * modification, are permitted provided that the following conditions are + * met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "libgstc.h" diff --git a/libgstc/c/libgstc_socket.c b/libgstc/c/libgstc_socket.c index b7c64a0d..4e602f99 100644 --- a/libgstc/c/libgstc_socket.c +++ b/libgstc/c/libgstc_socket.c @@ -1,33 +1,33 @@ /* - * GStreamer Daemon - gst-launch on steroids - * C client library abstracting gstd interprocess communication - * - * Copyright (c) 2015-2018 RidgeRun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * modification, are permitted provided that the following conditions are + * met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include diff --git a/libgstc/c/libgstc_socket.h b/libgstc/c/libgstc_socket.h index 2a46b049..e2474224 100644 --- a/libgstc/c/libgstc_socket.h +++ b/libgstc/c/libgstc_socket.h @@ -1,33 +1,33 @@ /* - * GStreamer Daemon - gst-launch on steroids - * C client library abstracting gstd interprocess communication - * - * Copyright (c) 2015-2018 RidgeRun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * modification, are permitted provided that the following conditions are + * met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __LIBGSTC_SOCKET_H__ diff --git a/libgstc/c/libgstc_thread.c b/libgstc/c/libgstc_thread.c index fcf15147..eec977fe 100644 --- a/libgstc/c/libgstc_thread.c +++ b/libgstc/c/libgstc_thread.c @@ -1,33 +1,33 @@ /* - * GStreamer Daemon - gst-launch on steroids - * C client library abstracting gstd interprocess communication - * - * Copyright (c) 2015-2018 RidgeRun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * modification, are permitted provided that the following conditions are + * met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include diff --git a/libgstc/c/libgstc_thread.h b/libgstc/c/libgstc_thread.h index d303d5f4..3dc5fddb 100644 --- a/libgstc/c/libgstc_thread.h +++ b/libgstc/c/libgstc_thread.h @@ -1,33 +1,33 @@ /* - * GStreamer Daemon - gst-launch on steroids - * C client library abstracting gstd interprocess communication - * - * Copyright (c) 2015-2018 RidgeRun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * modification, are permitted provided that the following conditions are + * met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __LIBGSTC_THREAD_H__ diff --git a/libgstc/javascript/libgstc.js b/libgstc/javascript/libgstc.js index 6bf7f254..f1000759 100644 --- a/libgstc/javascript/libgstc.js +++ b/libgstc/javascript/libgstc.js @@ -1,33 +1,35 @@ /* - * GStreamer Daemon - gst-launch on steroids + * This file is part of GStreamer Daemon * JavaScript client library abstracting gstd interprocess communication * - * Copyright (c) 2015-2020 RidgeRun, LLC (http://www.ridgerun.com) + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * modification, are permitted provided that the following conditions are + * met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** GstClient - GstdClient Class */ diff --git a/libgstc/meson.build b/libgstc/meson.build index e94dcd19..582cbb8f 100644 --- a/libgstc/meson.build +++ b/libgstc/meson.build @@ -1,2 +1,4 @@ subdir('c') -subdir('python') +if not get_option('enable-python').disabled() + subdir('python') +endif diff --git a/libgstc/python/debian/changelog b/libgstc/python/debian/changelog new file mode 100644 index 00000000..d24a9cf0 --- /dev/null +++ b/libgstc/python/debian/changelog @@ -0,0 +1,48 @@ +pygstc (0.5.0-1) unstable; urgency=low + + * Improve meson integration + * Improve test drivers + * Integrate python tests to CI + * Support for Ubuntu 22.04 + + -- RidgeRun Engineering Mon, 22 Aug 2022 22:00:00 -0600 + +pygstc (0.4.0-1) unstable; urgency=low + + * Add refcount commands support + + -- RidgeRun Engineering Mon, 30 Mar 2022 17:00:00 -0600 + +pygstc (0.3.0-1) unstable; urgency=low + + * Add debian package + + -- RidgeRun Engineering Mon, 28 Mar 2022 16:00:00 -0600 + +pygstc (0.2.2-1) unstable; urgency=low + + * Add action support + + -- RidgeRun Engineering Thu, 03 Mar 2022 15:00:00 -0600 + +pygstc (0.2.1-1) unstable; urgency=low + + * Fix socket being wrongly configure to non-blocking + * Fix TCP reported timeout error code + * Make sure all bytes are sent by TCP + * Add buffer lenght check to verify emptiness + + -- RidgeRun Engineering Wed, 08 Dec 2021 15:00:00 -0600 + +pygstc (0.2.0-1) unstable; urgency=low + + * Add graph support + * Add verbose instruction + + -- RidgeRun Engineering Thu, 30 Apr 2020 15:00:00 -0600 + +pygstc (0.1.0-1) unstable; urgency=low + + * Initial pygstd version + + -- RidgeRun Engineering Mon, 16 Mar 2020 15:00:00 -0600 diff --git a/libgstc/python/debian/compat b/libgstc/python/debian/compat new file mode 100644 index 00000000..b4de3947 --- /dev/null +++ b/libgstc/python/debian/compat @@ -0,0 +1 @@ +11 diff --git a/libgstc/python/debian/control b/libgstc/python/debian/control new file mode 100644 index 00000000..14ef01c3 --- /dev/null +++ b/libgstc/python/debian/control @@ -0,0 +1,18 @@ +Source: pygstc +Section: python +Priority: optional +Maintainer: RidgeRun +Build-Depends: debhelper (>= 11), + dh-python, + python3-setuptools, + python3 +Standards-Version: 4.1.3 +X-Python3-Version: >= 3.5 + +Package: pygstc +Architecture: all +Depends: ${misc:Depends}, + ${python3:Depends}, + gstd (>=0.14.0-1) +Description: Python GStreamer Daemon Client. + Standalone Python Client for RidgeRun's GStreamer Daemon diff --git a/libgstc/python/debian/copyright b/libgstc/python/debian/copyright new file mode 100644 index 00000000..1dd21e61 --- /dev/null +++ b/libgstc/python/debian/copyright @@ -0,0 +1,37 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: pygstc +Upstream-Contact: RidgeRun Engineering + +Files: * +Copyright: 2015-2022, RidgeRun Engineering +License: BSD-3-Clause + +Copyright: + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + \ No newline at end of file diff --git a/libgstc/python/debian/rules b/libgstc/python/debian/rules new file mode 100755 index 00000000..e4ab0787 --- /dev/null +++ b/libgstc/python/debian/rules @@ -0,0 +1,10 @@ +#!/usr/bin/make -f +#export DH_VERBOSE=1 +export PYBUILD_NAME=pygstc +export PYBUILD_DISABLE=test + +export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed + + +%: + dh $@ --with python3 --buildsystem=pybuild diff --git a/libgstc/python/debian/source/format b/libgstc/python/debian/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/libgstc/python/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/libgstc/python/meson.build b/libgstc/python/meson.build index 057114ba..4ccccd71 100644 --- a/libgstc/python/meson.build +++ b/libgstc/python/meson.build @@ -1 +1,25 @@ -run_command('pip3', 'install', '.') +pymod = import('python') +python = pymod.find_installation( + get_option('with-python-version'), + required : get_option('enable-python'), + disabler : true +) + +pythonver = python.language_version() +if pythonver.version_compare('<3.5') + error('Python @0@ is not supported anymore, please port your code to python3.5 or newer.'.format(python.language_version())) +endif + +pygstc_src_files = [ + 'pygstc/__init__.py', + 'pygstc/gstc.py', + 'pygstc/gstcerror.py', + 'pygstc/logger.py', + 'pygstc/tcp.py' +] + +python.install_sources( + pygstc_src_files, + subdir : 'pygstc', + pure : true +) diff --git a/libgstc/python/pygstc/gstc.py b/libgstc/python/pygstc/gstc.py index 29b42c7f..d7df0774 100644 --- a/libgstc/python/pygstc/gstc.py +++ b/libgstc/python/pygstc/gstc.py @@ -1,32 +1,34 @@ -# GStreamer Daemon - gst-launch on steroids +# This file is part of GStreamer Daemon # Python client library abstracting gstd interprocess communication - -# Copyright (c) 2015-2020 RidgeRun, LLC (http://www.ridgerun.com) - +# +# Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) +# # Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - +# modification, are permitted provided that the following conditions are +# met: +# # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. - -# 2. Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. - +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -# OF THE POSSIBILITY OF SUCH DAMAGE. +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import inspect import json @@ -150,6 +152,8 @@ def __init__( logger : CustomLogger Custom logger where all log messages from this class are going to be reported + timeout : float + Timeout in seconds to wait for a response. 0: non-blocking, None: blocking """ if logger: @@ -158,8 +162,9 @@ def __init__( self._logger = DummyLogger() self._ip = ip self._port = port - self._logger.info('Starting GstClient with ip=%s port=%d' - % (self._ip, self._port)) + self._logger.info( + 'Starting GstClient with ip={} port={}'.format( + self._ip, self._port)) self._ipc = Ipc(self._logger, self._ip, self._port) self._timeout = timeout self.ping_gstd() @@ -186,9 +191,12 @@ def _check_parameters(self, parameter_list, type_list): for i, parameter in enumerate(parameter_list): if not isinstance(parameter, type_list[i]): raise GstcError( - "%s TypeError: parameter %i: expected %s, '%s found" % - (inspect.stack()[1].function, i, type_list[i], - type(parameter)), GstcErrorCode.GSTC_MALFORMED) + "{} TypeError: parameter {}: expected {}, '{} found".format( + inspect.stack()[1].function, + i, + type_list[i], + type(parameter)), + GstcErrorCode.GSTC_MALFORMED) if type_list[i] == str: parameter_string_list += [parameter] elif type_list[i] == bool: @@ -226,8 +234,9 @@ def _send_cmd_line(self, cmd_line): jresult = self._ipc.send(cmd_line, timeout=self._timeout) result = json.loads(jresult) if result['code'] != GstcErrorCode.GSTC_OK.value: - self._logger.error('%s error: %s' % (cmd, - result['description'])) + self._logger.error( + '{} error: {}'.format( + cmd, result['description'])) raise GstdError(result['description'], result['code']) return result @@ -306,8 +315,9 @@ def bus_filter(self, pipe_name, filter): Error is triggered when the Gstd python client fails internally """ - self._logger.info('Setting bus read filter of pipeline %s to %s' - % (pipe_name, filter)) + self._logger.info( + 'Setting bus read filter of pipeline {} to {}'.format( + pipe_name, filter)) parameters = self._check_parameters([pipe_name, filter], [str, str]) self._send_cmd_line(['bus_filter'] + parameters) @@ -333,7 +343,7 @@ def bus_read(self, pipe_name): Command response """ - self._logger.info('Reading bus of pipeline %s' % pipe_name) + self._logger.info('Reading bus of pipeline {}'.format(pipe_name)) parameters = self._check_parameters([pipe_name], [str]) result = self._send_cmd_line(['bus_read'] + parameters) return result['response'] @@ -357,8 +367,9 @@ def bus_timeout(self, pipe_name, timeout): Error is triggered when the Gstd python client fails internally """ - self._logger.info('Setting bus read timeout of pipeline %s to %s' - % (pipe_name, timeout)) + self._logger.info( + 'Setting bus read timeout of pipeline {} to {}'.format( + pipe_name, timeout)) parameters = self._check_parameters([pipe_name, timeout], [str, int]) self._send_cmd_line(['bus_timeout'] + parameters) @@ -388,8 +399,9 @@ def create( Error is triggered when the Gstd python client fails internally """ - self._logger.info('Creating property %s in uri %s with value "%s"' - % (property, uri, value)) + self._logger.info( + 'Creating property {} in uri {} with value "{}"'.format( + property, uri, value)) parameters = self._check_parameters( [uri, property, value], [str, str, str]) self._send_cmd_line(['create'] + parameters) @@ -483,8 +495,8 @@ def debug_threshold(self, threshold): Error is triggered when the Gstd python client fails internally """ - self._logger.info('Setting GStreamer debug threshold to %s' - % threshold) + self._logger.info( + 'Setting GStreamer debug threshold to {}'.format(threshold)) parameters = self._check_parameters([threshold], [str]) self._send_cmd_line(['debug_threshold'] + parameters) @@ -507,7 +519,7 @@ def delete(self, uri, name): Error is triggered when the Gstd python client fails internally """ - self._logger.info('Deleting name %s at uri "%s"' % (name, uri)) + self._logger.info('Deleting name {} at uri "{}"'.format(name, uri)) parameters = self._check_parameters([uri, name], [str, str]) self._send_cmd_line(['delete'] + parameters) @@ -543,8 +555,8 @@ def element_get( """ self._logger.info( - 'Getting value of element %s %s property in pipeline %s' % - (element, prop, pipe_name)) + 'Getting value of element {} {} property in pipeline {}'.format( + element, prop, pipe_name)) parameters = self._check_parameters( [pipe_name, element, prop], [str, str, str]) result = self._send_cmd_line(['element_get'] + parameters) @@ -579,8 +591,9 @@ def element_set( Error is triggered when the Gstd python client fails internally """ - self._logger.info('Setting element %s %s property in pipeline %s to:%s' - % (element, prop, pipe_name, value)) + self._logger.info( + 'Setting element {} {} property in pipeline {} to:{}'.format( + element, prop, pipe_name, value)) parameters = self._check_parameters( [pipe_name, element, prop, value], [str, str, str, str]) self._send_cmd_line(['element_set'] + parameters) @@ -602,8 +615,8 @@ def event_eos(self, pipe_name): Error is triggered when the Gstd python client fails internally """ - self._logger.info('Sending end-of-stream event to pipeline %s' - % pipe_name) + self._logger.info( + 'Sending end-of-stream event to pipeline {}'.format(pipe_name)) parameters = self._check_parameters([pipe_name], [str]) self._send_cmd_line(['event_eos'] + parameters) @@ -624,8 +637,8 @@ def event_flush_start(self, pipe_name): Error is triggered when the Gstd python client fails internally """ - self._logger.info('Putting pipeline %s in flushing mode' - % pipe_name) + self._logger.info( + 'Putting pipeline {} in flushing mode'.format(pipe_name)) parameters = self._check_parameters([pipe_name], [str]) self._send_cmd_line(['event_flush_start'] + parameters) @@ -648,8 +661,8 @@ def event_flush_stop(self, pipe_name, reset=True): Error is triggered when the Gstd python client fails internally """ - self._logger.info('Taking pipeline %s out of flushing mode' - % pipe_name) + self._logger.info( + 'Taking pipeline {} out of flushing mode'.format(pipe_name)) parameters = self._check_parameters([pipe_name, reset], [str, bool]) self._send_cmd_line(['event_flush_stop'] + parameters) @@ -694,8 +707,8 @@ def event_seek( Error is triggered when the Gstd python client fails internally """ - self._logger.info('Performing event seek in pipeline %s' - % pipe_name) + self._logger.info( + 'Performing event seek in pipeline {}'.format(pipe_name)) parameters = self._check_parameters( [ pipe_name, rate, format, flags, start_type, start, end_type, @@ -726,7 +739,7 @@ def list_elements(self, pipe_name): List of elements """ - self._logger.info('Listing elements of pipeline %s' % pipe_name) + self._logger.info('Listing elements of pipeline {}'.format(pipe_name)) parameters = self._check_parameters([pipe_name], [str]) result = self._send_cmd_line(['list_elements'] + parameters) return result['response']['nodes'] @@ -776,8 +789,9 @@ def list_properties(self, pipe_name, element): List of properties """ - self._logger.info('Listing properties of element %s from pipeline %s' - % (element, pipe_name)) + self._logger.info( + 'Listing properties of element {} from pipeline {}'.format( + element, pipe_name)) parameters = self._check_parameters([pipe_name, element], [str, str]) result = self._send_cmd_line(['list_properties'] + parameters) return result['response']['nodes'] @@ -806,8 +820,9 @@ def list_signals(self, pipe_name, element): List of signals """ - self._logger.info('Listing signals of element %s from pipeline %s' - % (element, pipe_name)) + self._logger.info( + 'Listing signals of element {} from pipeline {}'.format( + element, pipe_name)) parameters = self._check_parameters([pipe_name, element], [str, str]) result = self._send_cmd_line(['list_signals'] + parameters) return result['response']['nodes'] @@ -824,11 +839,33 @@ def pipeline_create(self, pipe_name, pipe_desc): Pipeline description (same as gst-launch-1.0) """ - self._logger.info('Creating pipeline %s with description "%s"' - % (pipe_name, pipe_desc)) + self._logger.info( + 'Creating pipeline {} with description "{}"'.format( + pipe_name, pipe_desc)) parameters = self._check_parameters([pipe_name, pipe_desc], [str, str]) self._send_cmd_line(['pipeline_create'] + parameters) + def pipeline_create_ref(self, pipe_name, pipe_desc): + """ + Create a new pipeline based on the name and description using refcount. + The refcount works similarly to GObject references. If the command + is called but the refcount is greater than 0 nothing will happen + and the refcount will increment. + + Parameters + ---------- + pipe_name: string + The name of the pipeline + pipe_desc: string + Pipeline description (same as gst-launch-1.0) + """ + + self._logger.info( + 'Creating pipeline by reference {} with description "{}"'.format( + pipe_name, pipe_desc)) + parameters = self._check_parameters([pipe_name, pipe_desc], [str, str]) + self._send_cmd_line(['pipeline_create_ref'] + parameters) + def pipeline_delete(self, pipe_name): """ Delete the pipeline with the given name. @@ -846,10 +883,35 @@ def pipeline_delete(self, pipe_name): Error is triggered when the Gstd python client fails internally """ - self._logger.info('Deleting pipeline %s' % pipe_name) + self._logger.info('Deleting pipeline {}'.format(pipe_name)) parameters = self._check_parameters([pipe_name], [str]) self._send_cmd_line(['pipeline_delete'] + parameters) + def pipeline_delete_ref(self, pipe_name): + """ + Delete the pipeline with the given name using refcount. + The refcount works similarly to GObject references. If the command + is called but the refcount is greater than 1 nothing will happen + and the refcount will decrement. + + Parameters + ---------- + pipe_name: string + The name of the pipeline + + Raises + ------ + GstdError + Error is triggered when Gstd IPC fails + GstcError + Error is triggered when the Gstd python client fails internally + """ + + self._logger.info( + 'Deleting pipeline by reference {}'.format(pipe_name)) + parameters = self._check_parameters([pipe_name], [str]) + self._send_cmd_line(['pipeline_delete_ref'] + parameters) + def pipeline_pause(self, pipe_name): """ Set the pipeline to paused. @@ -867,7 +929,7 @@ def pipeline_pause(self, pipe_name): Error is triggered when the Gstd python client fails internally """ - self._logger.info('Pausing pipeline %s' % pipe_name) + self._logger.info('Pausing pipeline {}'.format(pipe_name)) parameters = self._check_parameters([pipe_name], [str]) self._send_cmd_line(['pipeline_pause'] + parameters) @@ -888,10 +950,34 @@ def pipeline_play(self, pipe_name): Error is triggered when the Gstd python client fails internally """ - self._logger.info('Playing pipeline %s' % pipe_name) + self._logger.info('Playing pipeline {}'.format(pipe_name)) parameters = self._check_parameters([pipe_name], [str]) self._send_cmd_line(['pipeline_play'] + parameters) + def pipeline_play_ref(self, pipe_name): + """ + Set the pipeline to playing using refcount. + The refcount works similarly to GObject references. If the command + is called but the refcount is greater than 0 nothing will happen + and the refcount will increment. + + Parameters + ---------- + pipe_name: string + The name of the pipeline + + Raises + ------ + GstdError + Error is triggered when Gstd IPC fails + GstcError + Error is triggered when the Gstd python client fails internally + """ + + self._logger.info('Playing pipeline by reference {}'.format(pipe_name)) + parameters = self._check_parameters([pipe_name], [str]) + self._send_cmd_line(['pipeline_play_ref'] + parameters) + def pipeline_stop(self, pipe_name): """ Set the pipeline to null. @@ -909,10 +995,34 @@ def pipeline_stop(self, pipe_name): Error is triggered when the Gstd python client fails internally """ - self._logger.info('Stoping pipeline %s' % pipe_name) + self._logger.info('Stoping pipeline {}'.format(pipe_name)) parameters = self._check_parameters([pipe_name], [str]) self._send_cmd_line(['pipeline_stop'] + parameters) + def pipeline_stop_ref(self, pipe_name): + """ + Set the pipeline to null using refcount. + The refcount works similarly to GObject references. If the command + is called but the refcount is greater than 1 nothing will happen + and the refcount will decrement. + + Parameters + ---------- + pipe_name: string + The name of the pipeline + + Raises + ------ + GstdError + Error is triggered when Gstd IPC fails + GstcError + Error is triggered when the Gstd python client fails internally + """ + + self._logger.info('Stoping pipeline by reference {}'.format(pipe_name)) + parameters = self._check_parameters([pipe_name], [str]) + self._send_cmd_line(['pipeline_stop_ref'] + parameters) + def pipeline_get_graph(self, pipe_name): """ Get the pipeline graph. @@ -935,7 +1045,7 @@ def pipeline_get_graph(self, pipe_name): Pipeline graph in GraphViz dot format """ - self._logger.info('Getting the pipeline %s graph' % pipe_name) + self._logger.info('Getting the pipeline {} graph'.format(pipe_name)) parameters = self._check_parameters([pipe_name], [str]) result = self._send_cmd_line(['pipeline_get_graph'] + parameters) return result @@ -960,8 +1070,9 @@ def pipeline_verbose(self, pipe_name, value): Error is triggered when Gstd IPC fails """ - self._logger.info('Setting the pipeline %s verbose mode to %s' - % (pipe_name, value)) + self._logger.info( + 'Setting the pipeline {} verbose mode to {}'.format( + pipe_name, value)) parameters = self._check_parameters([pipe_name, value], [str, bool]) self._send_cmd_line(['pipeline_verbose'] + parameters) @@ -987,7 +1098,7 @@ def read(self, uri): Command response """ - self._logger.info('Reading uri %s' % uri) + self._logger.info('Reading uri {}'.format(uri)) parameters = self._check_parameters([uri], [str]) result = self._send_cmd_line(['read'] + parameters) return result['response'] @@ -1024,8 +1135,8 @@ def signal_connect( """ self._logger.info( - 'Connecting to signal %s of element %s from pipeline %s' % - (signal, element, pipe_name)) + 'Connecting to signal {} of element {} from pipeline {}'.format( + signal, element, pipe_name)) parameters = self._check_parameters( [pipe_name, element, signal], [str, str, str]) result = self._send_cmd_line(['signal_connect'] + parameters) @@ -1058,8 +1169,8 @@ def signal_disconnect( """ self._logger.info( - 'Disconnecting from signal %s of element %s from pipeline %s' % - (signal, element, pipe_name)) + 'Disconnecting from signal {} of element {} from pipeline {}'.format( + signal, element, pipe_name)) parameters = self._check_parameters( [pipe_name, element, signal], [str, str, str]) self._send_cmd_line(['signal_disconnect'] + parameters) @@ -1095,8 +1206,8 @@ def signal_timeout( """ self._logger.info( - 'Connecting to signal %s of element %s from pipeline %s with \ - timeout %s' % (signal, element, pipe_name, timeout)) + 'Connecting to signal {} of element {} from pipeline {} with \ + timeout {}'.format(signal, element, pipe_name, timeout)) parameters = self._check_parameters( [pipe_name, element, signal, timeout], [str, str, str, int]) self._send_cmd_line(['signal_timeout'] + parameters) @@ -1148,7 +1259,6 @@ def update(self, uri, value): Error is triggered when the Gstd python client fails internally """ - self._logger.info('Updating uri %s with value "%s"' % (uri, - value)) + self._logger.info('Updating uri {} with value "{}"'.format(uri, value)) parameters = self._check_parameters([uri, value], [str, str]) self._send_cmd_line(['update'] + parameters) diff --git a/libgstc/python/pygstc/gstcerror.py b/libgstc/python/pygstc/gstcerror.py index 96b8a70e..0860e6ea 100644 --- a/libgstc/python/pygstc/gstcerror.py +++ b/libgstc/python/pygstc/gstcerror.py @@ -1,32 +1,34 @@ -# GStreamer Daemon - gst-launch on steroids +# This file is part of GStreamer Daemon # Python client library abstracting gstd interprocess communication - -# Copyright (c) 2015-2020 RidgeRun, LLC (http://www.ridgerun.com) - +# +# Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) +# # Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: - +# modification, are permitted provided that the following conditions are +# met: +# # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. - -# 2. Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. - +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -# OF THE POSSIBILITY OF SUCH DAMAGE. +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. from enum import Enum diff --git a/libgstc/python/pygstc/tcp.py b/libgstc/python/pygstc/tcp.py index 25219e0f..7f79996b 100644 --- a/libgstc/python/pygstc/tcp.py +++ b/libgstc/python/pygstc/tcp.py @@ -104,7 +104,7 @@ def send(self, line, timeout=None): Decoded JSON string with the response """ data = None - self._logger.debug('GSTD socket sending line: %s' % line) + self._logger.debug('GSTD socket sending line: {}'.format(line)) try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) diff --git a/libgstc/python/setup.py b/libgstc/python/setup.py index 09a57a87..c9992935 100755 --- a/libgstc/python/setup.py +++ b/libgstc/python/setup.py @@ -2,7 +2,7 @@ # GStreamer Daemon - gst-launch on steroids # Python client library abstracting gstd interprocess communication -# Copyright (c) 2015-2020 RidgeRun, LLC (http://www.ridgerun.com) +# Copyright (c) 2020-2022 RidgeRun, LLC (http://www.ridgerun.com) # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -33,7 +33,7 @@ setup( name='pygstc', - version='0.2.2', + version='0.5.0', description='Python GStreamer Daemon Client', long_description='Python GStreamer Daemon Client', long_description_content_type='text/markdown', diff --git a/libgstd/Makefile.am b/libgstd/Makefile.am index 5b4bb5a7..41bd6267 100644 --- a/libgstd/Makefile.am +++ b/libgstd/Makefile.am @@ -63,6 +63,7 @@ libgstd_@GSTD_API_VERSION@_la_SOURCES = \ libgstd.c libgstd_@GSTD_API_VERSION@_la_CFLAGS = \ + $(GSTD_CFLAGS) \ $(GST_CFLAGS) \ -I$(top_srcdir)/gstd/ \ $(GIO_CFLAGS) \ @@ -73,7 +74,14 @@ libgstd_@GSTD_API_VERSION@_la_CFLAGS = \ -DGSTD_RUN_STATE_DIR=\"$(GSTD_RUN_STATE_DIR)\" \ $(JANSSON_CFLAGS) -pthread -libgstd_@GSTD_API_VERSION@_la_LDFLAGS = $(GST_LIBS) $(GIO_LIBS) $(GJSON_LIBS) $(LIBSOUP_LIBS) $(JANSSON_LIBS) -pthread +libgstd_@GSTD_API_VERSION@_la_LDFLAGS = \ + $(GSTD_LIBS) \ + $(GST_LIBS) \ + $(GIO_LIBS) \ + $(GJSON_LIBS) \ + $(LIBSOUP_LIBS) \ + $(JANSSON_LIBS) \ + -pthread noinst_HEADERS = \ gstd_action.h \ diff --git a/libgstd/gstd.h b/libgstd/gstd.h index f9de3cc7..b388646a 100644 --- a/libgstd/gstd.h +++ b/libgstd/gstd.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2021 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __LIBGSTD_H__ diff --git a/libgstd/gstd_action.c b/libgstd/gstd_action.c index ba8a87dc..cee64b34 100644 --- a/libgstd/gstd_action.c +++ b/libgstd/gstd_action.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H @@ -222,8 +223,7 @@ gstd_action_create_default (GstdObject * object, const gchar * name, g_signal_query (action_id, &query); if (query.n_params > 0) { - GST_ERROR_OBJECT (action, - "Only actions with no parameters are supported"); + GST_ERROR_OBJECT (action, "Only actions with no parameters are supported"); ret = GSTD_BAD_VALUE; goto out; } diff --git a/libgstd/gstd_action.h b/libgstd/gstd_action.h index bf5eceb6..4a59c026 100644 --- a/libgstd/gstd_action.h +++ b/libgstd/gstd_action.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_ACTION_H__ diff --git a/libgstd/gstd_bus_msg.c b/libgstd/gstd_bus_msg.c index 09331aab..85dafa9a 100644 --- a/libgstd/gstd_bus_msg.c +++ b/libgstd/gstd_bus_msg.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2020 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/libgstd/gstd_bus_msg.h b/libgstd/gstd_bus_msg.h index c52c3c03..55322d39 100644 --- a/libgstd/gstd_bus_msg.h +++ b/libgstd/gstd_bus_msg.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_BUS_MSG_H__ diff --git a/libgstd/gstd_bus_msg_element.c b/libgstd/gstd_bus_msg_element.c index ab3b9cf2..d831d233 100644 --- a/libgstd/gstd_bus_msg_element.c +++ b/libgstd/gstd_bus_msg_element.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/libgstd/gstd_bus_msg_element.h b/libgstd/gstd_bus_msg_element.h index a1e12277..1448dfc1 100644 --- a/libgstd/gstd_bus_msg_element.h +++ b/libgstd/gstd_bus_msg_element.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_BUS_MSG_ELEMENT_H__ diff --git a/libgstd/gstd_bus_msg_notify.c b/libgstd/gstd_bus_msg_notify.c index bbcdd193..ae87be57 100644 --- a/libgstd/gstd_bus_msg_notify.c +++ b/libgstd/gstd_bus_msg_notify.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2020 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/libgstd/gstd_bus_msg_notify.h b/libgstd/gstd_bus_msg_notify.h index 35ef3b51..426fb698 100644 --- a/libgstd/gstd_bus_msg_notify.h +++ b/libgstd/gstd_bus_msg_notify.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2020 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_BUS_MSG_NOTIFY_H__ diff --git a/libgstd/gstd_bus_msg_qos.c b/libgstd/gstd_bus_msg_qos.c index 55838612..10951397 100644 --- a/libgstd/gstd_bus_msg_qos.c +++ b/libgstd/gstd_bus_msg_qos.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/libgstd/gstd_bus_msg_qos.h b/libgstd/gstd_bus_msg_qos.h index 122c8be6..3c78379c 100644 --- a/libgstd/gstd_bus_msg_qos.h +++ b/libgstd/gstd_bus_msg_qos.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_BUS_MSG_QOS_H__ diff --git a/libgstd/gstd_bus_msg_simple.c b/libgstd/gstd_bus_msg_simple.c index 14545d41..0474ed6d 100644 --- a/libgstd/gstd_bus_msg_simple.c +++ b/libgstd/gstd_bus_msg_simple.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/libgstd/gstd_bus_msg_simple.h b/libgstd/gstd_bus_msg_simple.h index 8dab7de4..411e841b 100644 --- a/libgstd/gstd_bus_msg_simple.h +++ b/libgstd/gstd_bus_msg_simple.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_BUS_MSG_SIMPLE_H__ diff --git a/libgstd/gstd_bus_msg_state_changed.c b/libgstd/gstd_bus_msg_state_changed.c index e2680b0c..98e43ddb 100644 --- a/libgstd/gstd_bus_msg_state_changed.c +++ b/libgstd/gstd_bus_msg_state_changed.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2020 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/libgstd/gstd_bus_msg_state_changed.h b/libgstd/gstd_bus_msg_state_changed.h index 96e4dc06..802dfadd 100644 --- a/libgstd/gstd_bus_msg_state_changed.h +++ b/libgstd/gstd_bus_msg_state_changed.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2020 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_BUS_MSG_STATE_CHANGED_H__ diff --git a/libgstd/gstd_bus_msg_stream_status.c b/libgstd/gstd_bus_msg_stream_status.c index b9b8db47..da717a57 100644 --- a/libgstd/gstd_bus_msg_stream_status.c +++ b/libgstd/gstd_bus_msg_stream_status.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/libgstd/gstd_bus_msg_stream_status.h b/libgstd/gstd_bus_msg_stream_status.h index 84b9e3f0..9da05646 100644 --- a/libgstd/gstd_bus_msg_stream_status.h +++ b/libgstd/gstd_bus_msg_stream_status.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_BUS_MSG_STREAM_STATUS_H__ diff --git a/libgstd/gstd_callback.c b/libgstd/gstd_callback.c index 24801821..332a15f2 100644 --- a/libgstd/gstd_callback.c +++ b/libgstd/gstd_callback.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2019 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/libgstd/gstd_callback.h b/libgstd/gstd_callback.h index 106c53df..c585238b 100644 --- a/libgstd/gstd_callback.h +++ b/libgstd/gstd_callback.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2019 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more dergrtails. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_CALLBACK_H__ diff --git a/libgstd/gstd_debug.c b/libgstd/gstd_debug.c index 4ee6ecf5..45a902ba 100644 --- a/libgstd/gstd_debug.c +++ b/libgstd/gstd_debug.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/libgstd/gstd_debug.h b/libgstd/gstd_debug.h index 132f24bc..55cea013 100644 --- a/libgstd/gstd_debug.h +++ b/libgstd/gstd_debug.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_DEBUG_H__ #define __GSTD_DEBUG_H__ diff --git a/libgstd/gstd_element.c b/libgstd/gstd_element.c index 8b87d548..374ba5fe 100644 --- a/libgstd/gstd_element.c +++ b/libgstd/gstd_element.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H @@ -461,7 +462,7 @@ gstd_element_signals_to_string (GstdElement * self, GstdIFormatter * formatter) void gstd_element_actions_to_string (GstdElement * self, GstdIFormatter * formatter) { - GList *action_list; + GList *action_list = NULL; g_return_if_fail (GSTD_IS_OBJECT (self)); @@ -474,6 +475,7 @@ void gstd_element_internal_to_string (GstdElement * self, gchar ** outstring) { GstdIFormatter *formatter = NULL; + g_return_if_fail (GSTD_IS_OBJECT (self)); formatter = g_object_new (GSTD_TYPE_JSON_BUILDER, NULL); diff --git a/libgstd/gstd_element.h b/libgstd/gstd_element.h index 5a98daab..8944c4ef 100644 --- a/libgstd/gstd_element.h +++ b/libgstd/gstd_element.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_ELEMENT_H__ diff --git a/libgstd/gstd_event_creator.c b/libgstd/gstd_event_creator.c index 0704aa9e..d1cefa4d 100644 --- a/libgstd/gstd_event_creator.c +++ b/libgstd/gstd_event_creator.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/libgstd/gstd_event_creator.h b/libgstd/gstd_event_creator.h index 3a1a8793..fa2ff2f7 100644 --- a/libgstd/gstd_event_creator.h +++ b/libgstd/gstd_event_creator.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_EVENT_CREATOR_H__ diff --git a/libgstd/gstd_event_factory.c b/libgstd/gstd_event_factory.c index 968cdaee..5253314d 100644 --- a/libgstd/gstd_event_factory.c +++ b/libgstd/gstd_event_factory.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/libgstd/gstd_event_factory.h b/libgstd/gstd_event_factory.h index 156574c6..c6e15ba4 100644 --- a/libgstd/gstd_event_factory.h +++ b/libgstd/gstd_event_factory.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_EVENT_FACTORY_H__ #define __GSTD_EVENT_FACTORY_H__ diff --git a/libgstd/gstd_event_handler.c b/libgstd/gstd_event_handler.c index 39a69f05..1259e3e1 100644 --- a/libgstd/gstd_event_handler.c +++ b/libgstd/gstd_event_handler.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/libgstd/gstd_event_handler.h b/libgstd/gstd_event_handler.h index 4775b40b..e43f1cb6 100644 --- a/libgstd/gstd_event_handler.h +++ b/libgstd/gstd_event_handler.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_EVENT_HANDLER_H__ diff --git a/libgstd/gstd_http.c b/libgstd/gstd_http.c index 21b32edc..ef4a20f5 100644 --- a/libgstd/gstd_http.c +++ b/libgstd/gstd_http.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2020 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H @@ -27,6 +28,7 @@ #include #include "gstd_http.h" +#include "gstd_parser.h" /* Gstd HTTP debugging category */ GST_DEBUG_CATEGORY_STATIC (gstd_http_debug); @@ -457,6 +459,7 @@ static gboolean gstd_http_init_get_option_group (GstdIpc * base, GOptionGroup ** group) { GstdHttp *self = GSTD_HTTP (base); + GOptionEntry http_args[] = { {"enable-http-protocol", 't', 0, G_OPTION_ARG_NONE, &base->enabled, "Enable attach the server through given HTTP ports ", NULL} @@ -493,6 +496,7 @@ gstd_http_stop (GstdIpc * base) { GstdHttp *self = NULL; GstdSession *session = NULL; + g_return_val_if_fail (base, GSTD_NULL_ARGUMENT); self = GSTD_HTTP (base); diff --git a/libgstd/gstd_http.h b/libgstd/gstd_http.h index 0f38d021..7a193496 100644 --- a/libgstd/gstd_http.h +++ b/libgstd/gstd_http.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_HTTP_H__ #define __GSTD_HTTP_H__ diff --git a/libgstd/gstd_icreator.c b/libgstd/gstd_icreator.c index fbe91aa5..c2d3c51c 100644 --- a/libgstd/gstd_icreator.c +++ b/libgstd/gstd_icreator.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "gstd_icreator.h" diff --git a/libgstd/gstd_icreator.h b/libgstd/gstd_icreator.h index 52cab01e..49ce6031 100644 --- a/libgstd/gstd_icreator.h +++ b/libgstd/gstd_icreator.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_ICREATOR_H__ diff --git a/libgstd/gstd_ideleter.c b/libgstd/gstd_ideleter.c index 819f373e..9ea57c95 100644 --- a/libgstd/gstd_ideleter.c +++ b/libgstd/gstd_ideleter.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "gstd_ideleter.h" diff --git a/libgstd/gstd_ideleter.h b/libgstd/gstd_ideleter.h index 23920ef8..668989d8 100644 --- a/libgstd/gstd_ideleter.h +++ b/libgstd/gstd_ideleter.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_IDELETER_H__ diff --git a/libgstd/gstd_iformatter.c b/libgstd/gstd_iformatter.c index 27b40894..943cd820 100644 --- a/libgstd/gstd_iformatter.c +++ b/libgstd/gstd_iformatter.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "gstd_iformatter.h" diff --git a/libgstd/gstd_iformatter.h b/libgstd/gstd_iformatter.h index f5aa81e4..4f7b086e 100644 --- a/libgstd/gstd_iformatter.h +++ b/libgstd/gstd_iformatter.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_IFORMATTER_H__ diff --git a/libgstd/gstd_ipc.c b/libgstd/gstd_ipc.c index 1ba51737..8731e6e1 100644 --- a/libgstd/gstd_ipc.c +++ b/libgstd/gstd_ipc.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/libgstd/gstd_ipc.h b/libgstd/gstd_ipc.h index 2a15f062..fc62dad8 100644 --- a/libgstd/gstd_ipc.h +++ b/libgstd/gstd_ipc.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ /** @@ -57,7 +58,6 @@ #include "gstd_object.h" #include "gstd_pipeline.h" #include "gstd_session.h" -#include "gstd_parser.h" G_BEGIN_DECLS #define GSTD_TYPE_IPC \ diff --git a/libgstd/gstd_ireader.c b/libgstd/gstd_ireader.c index b600639d..98f325ce 100644 --- a/libgstd/gstd_ireader.c +++ b/libgstd/gstd_ireader.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "gstd_ireader.h" diff --git a/libgstd/gstd_ireader.h b/libgstd/gstd_ireader.h index 3f183151..1b151065 100644 --- a/libgstd/gstd_ireader.h +++ b/libgstd/gstd_ireader.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_IREADER_H__ diff --git a/libgstd/gstd_iupdater.c b/libgstd/gstd_iupdater.c index b22effb0..51b683ce 100644 --- a/libgstd/gstd_iupdater.c +++ b/libgstd/gstd_iupdater.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "gstd_iupdater.h" diff --git a/libgstd/gstd_iupdater.h b/libgstd/gstd_iupdater.h index ee5213b1..e769d03c 100644 --- a/libgstd/gstd_iupdater.h +++ b/libgstd/gstd_iupdater.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_IUPDATER_H__ diff --git a/libgstd/gstd_json_builder.c b/libgstd/gstd_json_builder.c index eb4fa561..c8096433 100644 --- a/libgstd/gstd_json_builder.c +++ b/libgstd/gstd_json_builder.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "gstd_json_builder.h" @@ -195,6 +196,11 @@ gstd_json_set_value (GstdIFormatter * iface, const GValue * value) double_value = g_value_get_double (value); json_builder_add_double_value (self->json_builder, double_value); break; + case G_TYPE_STRING: + str_value = g_strdup (g_value_get_string (value)); + json_builder_add_string_value (self->json_builder, str_value); + g_free (str_value); + break; default: /* if the gvalue is not a boolean, integer or float point value, then * gvalue is converted to string diff --git a/libgstd/gstd_json_builder.h b/libgstd/gstd_json_builder.h index a554c74e..58ce268d 100644 --- a/libgstd/gstd_json_builder.h +++ b/libgstd/gstd_json_builder.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_JSON_BUILDER_H__ diff --git a/libgstd/gstd_list.c b/libgstd/gstd_list.c index 83d27def..2664b17e 100644 --- a/libgstd/gstd_list.c +++ b/libgstd/gstd_list.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/libgstd/gstd_list.h b/libgstd/gstd_list.h index 006eba54..bc2f2ba6 100644 --- a/libgstd/gstd_list.h +++ b/libgstd/gstd_list.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_LIST_H__ diff --git a/libgstd/gstd_list_reader.c b/libgstd/gstd_list_reader.c index 11dc021c..2ccb3056 100644 --- a/libgstd/gstd_list_reader.c +++ b/libgstd/gstd_list_reader.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include diff --git a/libgstd/gstd_list_reader.h b/libgstd/gstd_list_reader.h index 5df4ab0a..b9e3cfb3 100644 --- a/libgstd/gstd_list_reader.h +++ b/libgstd/gstd_list_reader.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_LIST_READER_H__ diff --git a/libgstd/gstd_log.c b/libgstd/gstd_log.c index df5a9d25..fa176f6d 100644 --- a/libgstd/gstd_log.c +++ b/libgstd/gstd_log.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2021 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H @@ -47,8 +48,8 @@ gstd_log_proxy (GstDebugCategory * category, GstDebugLevel level, static FILE *_gstdlog = NULL; static FILE *_gstlog = NULL; - static gchar *gstd_filename; - static gchar *gst_filename; + static gchar *gstd_filename = NULL; + static gchar *gst_filename = NULL; gboolean gstd_log_init (const gchar * gstdfilename, const gchar * gstfilename) @@ -154,8 +155,9 @@ gstd_log_get_filename (const gchar * filename, const gchar * default_filename) return g_strdup (filename); } else { g_printerr - ("WARNING: The pid filename is not absolute since default filename\n"); - return g_strdup (default_filename);; + ("WARNING: The pid filename is not absolute, falling back to: %s\n", + default_filename); + return g_strdup (default_filename); } } diff --git a/libgstd/gstd_log.h b/libgstd/gstd_log.h index 7d69ca50..b89e237f 100644 --- a/libgstd/gstd_log.h +++ b/libgstd/gstd_log.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2021 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_LOG_H__ diff --git a/libgstd/gstd_msg_reader.c b/libgstd/gstd_msg_reader.c index 8fd5d9f7..0a027a52 100644 --- a/libgstd/gstd_msg_reader.c +++ b/libgstd/gstd_msg_reader.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include diff --git a/libgstd/gstd_msg_reader.h b/libgstd/gstd_msg_reader.h index fc093069..e2df63bb 100644 --- a/libgstd/gstd_msg_reader.h +++ b/libgstd/gstd_msg_reader.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_MSG_READER_H__ diff --git a/libgstd/gstd_msg_type.c b/libgstd/gstd_msg_type.c index d9178bff..6afcb258 100644 --- a/libgstd/gstd_msg_type.c +++ b/libgstd/gstd_msg_type.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H @@ -27,7 +28,7 @@ GType gstd_msg_type_get_type (void) { - static volatile gsize gstd_msg_type_type = 0; + static gsize gstd_msg_type_type = 0; static const GFlagsValue gstd_msg_type[] = { {GST_MESSAGE_UNKNOWN, "GST_MESSAGE_UNKNOWN", "unknown"}, {GST_MESSAGE_UNKNOWN, "GST_MESSAGE_UNKNOWN", "none"}, diff --git a/libgstd/gstd_msg_type.h b/libgstd/gstd_msg_type.h index 610bf99f..049b8187 100644 --- a/libgstd/gstd_msg_type.h +++ b/libgstd/gstd_msg_type.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_MSG_TYPE_H__ diff --git a/libgstd/gstd_no_creator.c b/libgstd/gstd_no_creator.c index 1b9d8418..90a891fe 100644 --- a/libgstd/gstd_no_creator.c +++ b/libgstd/gstd_no_creator.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "gstd_no_creator.h" diff --git a/libgstd/gstd_no_creator.h b/libgstd/gstd_no_creator.h index ba5502e5..74a5b67a 100644 --- a/libgstd/gstd_no_creator.h +++ b/libgstd/gstd_no_creator.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_NO_CREATOR_H__ diff --git a/libgstd/gstd_no_deleter.c b/libgstd/gstd_no_deleter.c index 43ae5466..924af213 100644 --- a/libgstd/gstd_no_deleter.c +++ b/libgstd/gstd_no_deleter.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "gstd_no_deleter.h" diff --git a/libgstd/gstd_no_deleter.h b/libgstd/gstd_no_deleter.h index e5bc90d3..77fd1562 100644 --- a/libgstd/gstd_no_deleter.h +++ b/libgstd/gstd_no_deleter.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_NO_DELETER_H__ diff --git a/libgstd/gstd_no_reader.c b/libgstd/gstd_no_reader.c index cb8768db..68cf7ab6 100644 --- a/libgstd/gstd_no_reader.c +++ b/libgstd/gstd_no_reader.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "gstd_no_reader.h" @@ -74,8 +75,6 @@ static GstdReturnCode gstd_no_reader_read (GstdIReader * iface, GstdObject * object, const gchar * name, GstdObject ** out) { - GST_ERROR_OBJECT (iface, "Unable to read from this resource"); - *out = NULL; return GSTD_NO_READ; diff --git a/libgstd/gstd_no_reader.h b/libgstd/gstd_no_reader.h index 2e2a514b..7b003c05 100644 --- a/libgstd/gstd_no_reader.h +++ b/libgstd/gstd_no_reader.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_NO_READER_H__ diff --git a/libgstd/gstd_no_updater.c b/libgstd/gstd_no_updater.c index 00753267..f7d05493 100644 --- a/libgstd/gstd_no_updater.c +++ b/libgstd/gstd_no_updater.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "gstd_no_updater.h" diff --git a/libgstd/gstd_no_updater.h b/libgstd/gstd_no_updater.h index c41e9703..b893a1b6 100644 --- a/libgstd/gstd_no_updater.h +++ b/libgstd/gstd_no_updater.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_NO_UPDATER_H__ diff --git a/libgstd/gstd_object.c b/libgstd/gstd_object.c index 35aab7bd..a3cca4b2 100644 --- a/libgstd/gstd_object.c +++ b/libgstd/gstd_object.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/libgstd/gstd_object.h b/libgstd/gstd_object.h index 9556f237..8118c38f 100644 --- a/libgstd/gstd_object.h +++ b/libgstd/gstd_object.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2021 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_OBJECT_H__ #define __GSTD_OBJECT_H__ diff --git a/libgstd/gstd_parser.c b/libgstd/gstd_parser.c index 265bcda8..821984ee 100644 --- a/libgstd/gstd_parser.c +++ b/libgstd/gstd_parser.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2020 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H @@ -22,8 +23,11 @@ #endif #include "gstd_event_handler.h" -#include "gstd_parser.h" +#include "gstd_pipeline.h" #include "gstd_session.h" +#include "gstd_state.h" + +#include "gstd_parser.h" #define check_argument(arg, code) \ if (NULL == (arg)) return (code) @@ -97,6 +101,14 @@ static GstdReturnCode gstd_parser_debug_color (GstdSession *, gchar *, gchar *, gchar **); static GstdReturnCode gstd_parser_debug_reset (GstdSession *, gchar *, gchar *, gchar **); +static GstdReturnCode gstd_parser_pipeline_create_ref (GstdSession *, gchar *, + gchar *, gchar **); +static GstdReturnCode gstd_parser_pipeline_delete_ref (GstdSession *, gchar *, + gchar *, gchar **); +static GstdReturnCode gstd_parser_pipeline_play_ref (GstdSession *, gchar *, + gchar *, gchar **); +static GstdReturnCode gstd_parser_pipeline_stop_ref (GstdSession *, gchar *, + gchar *, gchar **); typedef GstdReturnCode GstdFunc (GstdSession *, gchar *, gchar *, gchar **); typedef struct _GstdCmd @@ -147,6 +159,11 @@ static GstdCmd cmds[] = { {"debug_color", gstd_parser_debug_color}, {"debug_reset", gstd_parser_debug_reset}, + {"pipeline_create_ref", gstd_parser_pipeline_create_ref}, + {"pipeline_delete_ref", gstd_parser_pipeline_delete_ref}, + {"pipeline_play_ref", gstd_parser_pipeline_play_ref}, + {"pipeline_stop_ref", gstd_parser_pipeline_stop_ref}, + {NULL} }; @@ -154,7 +171,7 @@ static GstdReturnCode gstd_parser_parse_raw_cmd (GstdSession * session, gchar * action, gchar * args, gchar ** response) { - gchar **tokens; + gchar **tokens = NULL; gchar *uri, *rest; GstdObject *node; GstdReturnCode ret; @@ -204,7 +221,7 @@ GstdReturnCode gstd_parser_parse_cmd (GstdSession * session, const gchar * cmd, gchar ** response) { - gchar **tokens; + gchar **tokens = NULL; gchar *action, *args; GstdCmd *cb; GstdReturnCode ret = GSTD_BAD_COMMAND; @@ -271,7 +288,6 @@ gstd_parser_create (GstdSession * session, GstdObject * obj, gchar * args, goto out; gstd_object_read (obj, name, &new); - if (NULL != new) { gstd_object_to_string (new, response); g_object_unref (new); @@ -352,9 +368,7 @@ gstd_parser_pipeline_create (GstdSession * session, gchar * action, g_return_val_if_fail (GSTD_IS_SESSION (session), GSTD_NULL_ARGUMENT); uri = g_strdup_printf ("/pipelines %s", args ? args : ""); - ret = gstd_parser_parse_raw_cmd (session, (gchar *) "create", uri, response); - g_free (uri); return ret; @@ -453,7 +467,7 @@ gstd_parser_pipeline_verbose (GstdSession * session, gchar * action, #if GST_VERSION_MINOR >= 10 gchar *uri; - gchar **tokens; + gchar **tokens = NULL; g_return_val_if_fail (GSTD_IS_SESSION (session), GSTD_NULL_ARGUMENT); g_return_val_if_fail (args, GSTD_NULL_ARGUMENT); @@ -485,7 +499,7 @@ gstd_parser_element_set (GstdSession * session, gchar * action, gchar * args, { GstdReturnCode ret; gchar *uri; - gchar **tokens; + gchar **tokens = NULL; g_return_val_if_fail (GSTD_IS_SESSION (session), GSTD_NULL_ARGUMENT); g_return_val_if_fail (args, GSTD_NULL_ARGUMENT); @@ -512,7 +526,7 @@ gstd_parser_element_get (GstdSession * session, gchar * action, gchar * args, { GstdReturnCode ret; gchar *uri; - gchar **tokens; + gchar **tokens = NULL; g_return_val_if_fail (GSTD_IS_SESSION (session), GSTD_NULL_ARGUMENT); g_return_val_if_fail (args, GSTD_NULL_ARGUMENT); @@ -571,7 +585,7 @@ gstd_parser_list_properties (GstdSession * session, gchar * action, { GstdReturnCode ret; gchar *uri; - gchar **tokens; + gchar **tokens = NULL; g_return_val_if_fail (GSTD_IS_SESSION (session), GSTD_NULL_ARGUMENT); g_return_val_if_fail (args, GSTD_NULL_ARGUMENT); @@ -597,7 +611,7 @@ gstd_parser_list_signals (GstdSession * session, gchar * action, gchar * args, { GstdReturnCode ret; gchar *uri; - gchar **tokens; + gchar **tokens = NULL; g_return_val_if_fail (GSTD_IS_SESSION (session), GSTD_NULL_ARGUMENT); g_return_val_if_fail (args, GSTD_NULL_ARGUMENT); @@ -642,7 +656,7 @@ gstd_parser_bus_filter (GstdSession * session, gchar * action, { GstdReturnCode ret; gchar *uri; - gchar **tokens; + gchar **tokens = NULL; g_return_val_if_fail (GSTD_IS_SESSION (session), GSTD_NULL_ARGUMENT); g_return_val_if_fail (args, GSTD_NULL_ARGUMENT); @@ -667,7 +681,7 @@ gstd_parser_bus_timeout (GstdSession * session, gchar * action, gchar * args, { GstdReturnCode ret; gchar *uri; - gchar **tokens; + gchar **tokens = NULL; g_return_val_if_fail (GSTD_IS_SESSION (session), GSTD_NULL_ARGUMENT); g_return_val_if_fail (args, GSTD_NULL_ARGUMENT); @@ -711,7 +725,7 @@ gstd_parser_event_seek (GstdSession * session, gchar * action, gchar * args, { GstdReturnCode ret; gchar *uri; - gchar **tokens; + gchar **tokens = NULL; g_return_val_if_fail (GSTD_IS_SESSION (session), GSTD_NULL_ARGUMENT); g_return_val_if_fail (args, GSTD_NULL_ARGUMENT); @@ -755,7 +769,7 @@ gstd_parser_event_flush_stop (GstdSession * session, gchar * action, { GstdReturnCode ret; gchar *uri; - gchar **tokens; + gchar **tokens = NULL; g_return_val_if_fail (GSTD_IS_SESSION (session), GSTD_NULL_ARGUMENT); g_return_val_if_fail (args, GSTD_NULL_ARGUMENT); @@ -864,7 +878,7 @@ gstd_parser_signal_connect (GstdSession * session, gchar * action, { GstdReturnCode ret; gchar *uri; - gchar **tokens; + gchar **tokens = NULL; g_return_val_if_fail (GSTD_IS_SESSION (session), GSTD_NULL_ARGUMENT); g_return_val_if_fail (args, GSTD_NULL_ARGUMENT); @@ -892,7 +906,7 @@ gstd_parser_signal_disconnect (GstdSession * session, gchar * action, { GstdReturnCode ret; gchar *uri; - gchar **tokens; + gchar **tokens = NULL; g_return_val_if_fail (GSTD_IS_SESSION (session), GSTD_NULL_ARGUMENT); g_return_val_if_fail (args, GSTD_NULL_ARGUMENT); @@ -919,7 +933,7 @@ gstd_parser_action_emit (GstdSession * session, gchar * action, { GstdReturnCode ret; gchar *uri; - gchar **tokens; + gchar **tokens = NULL; g_return_val_if_fail (GSTD_IS_SESSION (session), GSTD_NULL_ARGUMENT); g_return_val_if_fail (args, GSTD_NULL_ARGUMENT); @@ -946,7 +960,7 @@ gstd_parser_signal_timeout (GstdSession * session, gchar * action, gchar * args, { GstdReturnCode ret; gchar *uri; - gchar **tokens; + gchar **tokens = NULL; g_return_val_if_fail (GSTD_IS_SESSION (session), GSTD_NULL_ARGUMENT); g_return_val_if_fail (args, GSTD_NULL_ARGUMENT); @@ -967,3 +981,209 @@ gstd_parser_signal_timeout (GstdSession * session, gchar * action, gchar * args, return ret; } + +static GstdReturnCode +gstd_parser_pipeline_create_ref (GstdSession * session, gchar * action, + gchar * args, gchar ** response) +{ + gchar **tokens = NULL; + gchar *description = NULL; + GstdObject *pipeline_list_node = NULL; + GstdObject *pipeline_node = NULL; + GstdReturnCode ret = GSTD_EOK; + + g_return_val_if_fail (GSTD_IS_SESSION (session), GSTD_NULL_ARGUMENT); + g_return_val_if_fail (action, GSTD_NULL_ARGUMENT); + g_return_val_if_fail (args, GSTD_NULL_ARGUMENT); + g_return_val_if_fail (response, GSTD_NULL_ARGUMENT); + + tokens = g_strsplit (args, " ", 2); + + /* Get the pipeline list node */ + ret = gstd_get_by_uri (session, "/pipelines", &pipeline_list_node); + if (ret) { + goto pipeline_list_node_error; + } + + GST_OBJECT_LOCK (session); + + /* Look for the pipeline node */ + pipeline_node = + gstd_list_find_child (GSTD_LIST (pipeline_list_node), tokens[0]); + + /* Pipeline doesn't exist */ + if (!pipeline_node) { + ret = gstd_parser_pipeline_create (session, action, args, response); + if (ret) { + goto create_error; + } + pipeline_node = + gstd_list_find_child (GSTD_LIST (pipeline_list_node), tokens[0]); + } else { + g_object_get (pipeline_node, "description", &description, NULL); + /* Return error code if the descriptions don't match */ + if (0 != g_strcmp0 (description, tokens[1])) { + ret = GSTD_EXISTING_NAME; + g_free (description); + goto create_error; + } + g_free (description); + } + ret = gstd_pipeline_increment_refcount (GSTD_PIPELINE (pipeline_node)); + +create_error: + GST_OBJECT_UNLOCK (session); + gst_object_unref (pipeline_list_node); +pipeline_list_node_error: + g_strfreev (tokens); + return ret; +} + +static GstdReturnCode +gstd_parser_pipeline_delete_ref (GstdSession * session, gchar * action, + gchar * args, gchar ** response) +{ + GstdObject *pipeline_list_node = NULL; + GstdObject *pipeline_node = NULL; + GstdReturnCode ret = GSTD_EOK; + guint refcount = 0; + + g_return_val_if_fail (GSTD_IS_SESSION (session), GSTD_NULL_ARGUMENT); + g_return_val_if_fail (action, GSTD_NULL_ARGUMENT); + g_return_val_if_fail (args, GSTD_NULL_ARGUMENT); + g_return_val_if_fail (response, GSTD_NULL_ARGUMENT); + + /* Get the pipeline list node */ + ret = gstd_get_by_uri (session, "/pipelines", &pipeline_list_node); + if (ret) { + goto pipeline_list_node_error; + } + + GST_OBJECT_LOCK (session); + + /* Look for the pipeline node */ + pipeline_node = gstd_list_find_child (GSTD_LIST (pipeline_list_node), args); + if (!pipeline_node) { + ret = GSTD_NO_PIPELINE; + goto pipeline_node_error; + } + + g_object_get (pipeline_node, "refcount", &refcount, NULL); + if (1 == refcount) { + ret = gstd_parser_pipeline_delete (session, action, args, response); + } else { + ret = gstd_pipeline_decrement_refcount (GSTD_PIPELINE (pipeline_node)); + } + +pipeline_node_error: + GST_OBJECT_UNLOCK (session); + gst_object_unref (pipeline_list_node); +pipeline_list_node_error: + return ret; +} + +static GstdReturnCode +gstd_parser_pipeline_play_ref (GstdSession * session, gchar * action, + gchar * args, gchar ** response) +{ + gchar *uri = NULL; + GstdObject *pipeline_node = NULL; + GstdObject *state_node = NULL; + GstdReturnCode ret = GSTD_EOK; + guint refcount = 0; + + g_return_val_if_fail (GSTD_IS_SESSION (session), GSTD_NULL_ARGUMENT); + g_return_val_if_fail (action, GSTD_NULL_ARGUMENT); + g_return_val_if_fail (args, GSTD_NULL_ARGUMENT); + g_return_val_if_fail (response, GSTD_NULL_ARGUMENT); + + /* Get the pipeline node */ + uri = g_strdup_printf ("/pipelines/%s", args); + ret = gstd_get_by_uri (session, uri, &pipeline_node); + g_free (uri); + if (ret) { + goto pipeline_node_error; + } + + /* Get the state node */ + uri = g_strdup_printf ("/pipelines/%s/state", args); + ret = gstd_get_by_uri (session, uri, &state_node); + g_free (uri); + if (ret) { + goto state_node_error; + } + + GST_OBJECT_LOCK (pipeline_node); + + g_object_get (state_node, "refcount", &refcount, NULL); + if (0 == refcount) { + ret = gstd_parser_pipeline_play (session, action, args, response); + if (ret) { + goto play_error; + } + } else { + gstd_object_to_string (state_node, response); + } + ret = gstd_state_increment_refcount (GSTD_STATE (state_node)); + +play_error: + GST_OBJECT_UNLOCK (pipeline_node); + gst_object_unref (state_node); +state_node_error: + gst_object_unref (pipeline_node); +pipeline_node_error: + return ret; +} + +static GstdReturnCode +gstd_parser_pipeline_stop_ref (GstdSession * session, gchar * action, + gchar * args, gchar ** response) +{ + gchar *uri = NULL; + GstdObject *pipeline_node = NULL; + GstdObject *state_node = NULL; + GstdReturnCode ret = GSTD_EOK; + guint refcount = 0; + + g_return_val_if_fail (GSTD_IS_SESSION (session), GSTD_NULL_ARGUMENT); + g_return_val_if_fail (action, GSTD_NULL_ARGUMENT); + g_return_val_if_fail (args, GSTD_NULL_ARGUMENT); + g_return_val_if_fail (response, GSTD_NULL_ARGUMENT); + + /* Get the pipeline node */ + uri = g_strdup_printf ("/pipelines/%s", args); + ret = gstd_get_by_uri (session, uri, &pipeline_node); + g_free (uri); + if (ret) { + goto pipeline_node_error; + } + + /* Get the state node */ + uri = g_strdup_printf ("/pipelines/%s/state", args); + ret = gstd_get_by_uri (session, uri, &state_node); + g_free (uri); + if (ret) { + goto state_node_error; + } + + GST_OBJECT_LOCK (pipeline_node); + + g_object_get (state_node, "refcount", &refcount, NULL); + if (1 == refcount) { + ret = gstd_parser_pipeline_stop (session, action, args, response); + if (ret) { + goto stop_error; + } + } else { + gstd_object_to_string (state_node, response); + } + ret = gstd_state_decrement_refcount (GSTD_STATE (state_node)); + +stop_error: + GST_OBJECT_UNLOCK (pipeline_node); + gst_object_unref (state_node); +state_node_error: + gst_object_unref (pipeline_node); +pipeline_node_error: + return ret; +} diff --git a/libgstd/gstd_parser.h b/libgstd/gstd_parser.h index 1efa1dac..a84bdaa8 100644 --- a/libgstd/gstd_parser.h +++ b/libgstd/gstd_parser.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_PARSER_H__ diff --git a/libgstd/gstd_pipeline.c b/libgstd/gstd_pipeline.c index e82bbc63..97c00c33 100644 --- a/libgstd/gstd_pipeline.c +++ b/libgstd/gstd_pipeline.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2020 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H @@ -24,16 +25,17 @@ #include #include -#include "gstd_pipeline.h" -#include "gstd_object.h" -#include "gstd_list.h" #include "gstd_element.h" #include "gstd_event_handler.h" -#include "gstd_pipeline_bus.h" +#include "gstd_list.h" #include "gstd_list_reader.h" +#include "gstd_object.h" +#include "gstd_pipeline_bus.h" #include "gstd_property_reader.h" #include "gstd_state.h" +#include "gstd_pipeline.h" + enum { PROP_DESCRIPTION = 1, @@ -45,6 +47,7 @@ enum PROP_DURATION, PROP_GRAPH, PROP_VERBOSE, + PROP_REFCOUNT, N_PROPERTIES // NOT A PROPERTY }; @@ -120,6 +123,13 @@ struct _GstdPipeline * Id to enable/disable deep notify logging (similar to adding -v to get-launch-1.0) */ gulong deep_notify_id; + + /** + * Reference count of pipeline creation. It is incremented with pipeline_create_ref + * and decremented with pipeline_delete_ref. When it reaches 0 the pipeline + * is deleted. + */ + guint refcount; }; struct _GstdPipelineClass @@ -203,6 +213,11 @@ gstd_pipeline_class_init (GstdPipelineClass * klass) "Verbose state for the media stream pipeline", GSTD_PIPELINE_DEFAULT_VERBOSE, G_PARAM_READWRITE | GSTD_PARAM_READ); + properties[PROP_REFCOUNT] = + g_param_spec_int ("refcount", "Reference Count", + "Reference count of pipeline creation", + 0, G_MAXINT, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); + g_object_class_install_properties (object_class, N_PROPERTIES, properties); /* Initialize debug category with nice colors */ @@ -222,6 +237,7 @@ gstd_pipeline_init (GstdPipeline * self) self->state = NULL; self->graph = NULL; self->deep_notify_id = 0; + self->refcount = 0; self->elements = g_object_new (GSTD_TYPE_LIST, "name", "elements", "node-type", GSTD_TYPE_ELEMENT, "flags", GSTD_PARAM_READ, NULL); @@ -365,6 +381,13 @@ gstd_pipeline_get_property (GObject * object, g_value_set_boolean (value, 0 != self->deep_notify_id); break; + case PROP_REFCOUNT: + GST_OBJECT_LOCK (self); + GST_DEBUG_OBJECT (self, "Returning refcount %u", self->refcount); + g_value_set_int (value, self->refcount); + GST_OBJECT_UNLOCK (self); + break; + case PROP_POSITION: if (!gst_element_query_position (self->pipeline, GST_FORMAT_TIME, &self->position)) { @@ -587,3 +610,25 @@ gstd_pipeline_fill_elements (GstdPipeline * self, GstElement * element) return GSTD_NO_PIPELINE; } } + +GstdReturnCode +gstd_pipeline_increment_refcount (GstdPipeline * self) +{ + g_return_val_if_fail (self, GSTD_NULL_ARGUMENT); + GST_OBJECT_LOCK (self); + self->refcount++; + GST_OBJECT_UNLOCK (self); + return GSTD_EOK; +} + +GstdReturnCode +gstd_pipeline_decrement_refcount (GstdPipeline * self) +{ + g_return_val_if_fail (self, GSTD_NULL_ARGUMENT); + GST_OBJECT_LOCK (self); + if (0 < self->refcount) { + self->refcount--; + } + GST_OBJECT_UNLOCK (self); + return GSTD_EOK; +} diff --git a/libgstd/gstd_pipeline.h b/libgstd/gstd_pipeline.h index 7b3c02c4..0f682d1d 100644 --- a/libgstd/gstd_pipeline.h +++ b/libgstd/gstd_pipeline.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_PIPELINE_H__ @@ -46,5 +47,23 @@ GType gstd_pipeline_get_type (void); GstdReturnCode gstd_pipeline_build (GstdPipeline * object); +/** + * Increment the create refcount stored in the pipeline + * + * \param self GstdPipeline object + * + * \return GstdReturnCode + **/ +GstdReturnCode gstd_pipeline_increment_refcount (GstdPipeline * self); + +/** + * Decrement the create refcount stored in the pipeline + * + * \param self GstdPipeline object + * + * \return GstdReturnCode + **/ +GstdReturnCode gstd_pipeline_decrement_refcount (GstdPipeline * self); + G_END_DECLS #endif // __GSTD_PIPELINE_H__ diff --git a/libgstd/gstd_pipeline_bus.c b/libgstd/gstd_pipeline_bus.c index cccc8622..56914a02 100644 --- a/libgstd/gstd_pipeline_bus.c +++ b/libgstd/gstd_pipeline_bus.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H @@ -143,7 +144,8 @@ gstd_pipeline_bus_set_property (GObject * object, switch (property_id) { case PROP_TIMEOUT: self->timeout = g_value_get_int64 (value); - GST_INFO_OBJECT (self, "Timeout changed to: %li", self->timeout); + GST_INFO_OBJECT (self, "Timeout changed to: %" G_GUINT64_FORMAT, + self->timeout); break; case PROP_TYPES: self->types = g_value_get_flags (value); diff --git a/libgstd/gstd_pipeline_bus.h b/libgstd/gstd_pipeline_bus.h index b5ef8eb6..80b79533 100644 --- a/libgstd/gstd_pipeline_bus.h +++ b/libgstd/gstd_pipeline_bus.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_PIPELINE_BUS_H__ diff --git a/libgstd/gstd_pipeline_creator.c b/libgstd/gstd_pipeline_creator.c index 0644a1e3..6bb89033 100644 --- a/libgstd/gstd_pipeline_creator.c +++ b/libgstd/gstd_pipeline_creator.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "gstd_pipeline_creator.h" diff --git a/libgstd/gstd_pipeline_creator.h b/libgstd/gstd_pipeline_creator.h index 0177953f..a165794b 100644 --- a/libgstd/gstd_pipeline_creator.h +++ b/libgstd/gstd_pipeline_creator.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_PIPELINE_CREATOR_H__ diff --git a/libgstd/gstd_pipeline_deleter.c b/libgstd/gstd_pipeline_deleter.c index 6aed1dbe..d90931d5 100644 --- a/libgstd/gstd_pipeline_deleter.c +++ b/libgstd/gstd_pipeline_deleter.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "gstd_pipeline_deleter.h" diff --git a/libgstd/gstd_pipeline_deleter.h b/libgstd/gstd_pipeline_deleter.h index 7d8564a5..4356fa06 100644 --- a/libgstd/gstd_pipeline_deleter.h +++ b/libgstd/gstd_pipeline_deleter.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_PIPELINE_DELETER_H__ diff --git a/libgstd/gstd_property.c b/libgstd/gstd_property.c index 29a132e6..8b3ecee5 100644 --- a/libgstd/gstd_property.c +++ b/libgstd/gstd_property.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/libgstd/gstd_property.h b/libgstd/gstd_property.h index 82999972..9d556de8 100644 --- a/libgstd/gstd_property.h +++ b/libgstd/gstd_property.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_PROPERTY_H__ diff --git a/libgstd/gstd_property_array.c b/libgstd/gstd_property_array.c index b1e31d58..5b828629 100644 --- a/libgstd/gstd_property_array.c +++ b/libgstd/gstd_property_array.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/libgstd/gstd_property_array.h b/libgstd/gstd_property_array.h index 6d556e6d..c69f6a06 100644 --- a/libgstd/gstd_property_array.h +++ b/libgstd/gstd_property_array.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_PROPERTY_ARRAY_H__ diff --git a/libgstd/gstd_property_boolean.c b/libgstd/gstd_property_boolean.c index 8e1a4098..e3deee87 100644 --- a/libgstd/gstd_property_boolean.c +++ b/libgstd/gstd_property_boolean.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/libgstd/gstd_property_boolean.h b/libgstd/gstd_property_boolean.h index e01ef5e8..73e715e7 100644 --- a/libgstd/gstd_property_boolean.h +++ b/libgstd/gstd_property_boolean.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_PROPERTY_BOOLEAN_H__ diff --git a/libgstd/gstd_property_enum.c b/libgstd/gstd_property_enum.c index f28f5b70..355dba0b 100644 --- a/libgstd/gstd_property_enum.c +++ b/libgstd/gstd_property_enum.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/libgstd/gstd_property_enum.h b/libgstd/gstd_property_enum.h index 96042ea0..d86d3912 100644 --- a/libgstd/gstd_property_enum.h +++ b/libgstd/gstd_property_enum.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_PROPERTY_ENUM_H__ diff --git a/libgstd/gstd_property_flags.c b/libgstd/gstd_property_flags.c index 59a92637..0f4a8091 100644 --- a/libgstd/gstd_property_flags.c +++ b/libgstd/gstd_property_flags.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/libgstd/gstd_property_flags.h b/libgstd/gstd_property_flags.h index a9ecb18f..be63727e 100644 --- a/libgstd/gstd_property_flags.h +++ b/libgstd/gstd_property_flags.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_PROPERTY_FLAGS_H__ diff --git a/libgstd/gstd_property_int.c b/libgstd/gstd_property_int.c index b8b40fde..503e9d6f 100644 --- a/libgstd/gstd_property_int.c +++ b/libgstd/gstd_property_int.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/libgstd/gstd_property_int.h b/libgstd/gstd_property_int.h index e34e5837..c54d7b2e 100644 --- a/libgstd/gstd_property_int.h +++ b/libgstd/gstd_property_int.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_PROPERTY_INT_H__ diff --git a/libgstd/gstd_property_reader.c b/libgstd/gstd_property_reader.c index daa11607..2e773dc4 100644 --- a/libgstd/gstd_property_reader.c +++ b/libgstd/gstd_property_reader.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include diff --git a/libgstd/gstd_property_reader.h b/libgstd/gstd_property_reader.h index d84dae50..92f73948 100644 --- a/libgstd/gstd_property_reader.h +++ b/libgstd/gstd_property_reader.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_PROPERTY_READER_H__ diff --git a/libgstd/gstd_property_string.c b/libgstd/gstd_property_string.c index 6723d45c..954d855a 100644 --- a/libgstd/gstd_property_string.c +++ b/libgstd/gstd_property_string.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/libgstd/gstd_property_string.h b/libgstd/gstd_property_string.h index 42c66258..80b61286 100644 --- a/libgstd/gstd_property_string.h +++ b/libgstd/gstd_property_string.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_PROPERTY_STRING_H__ diff --git a/libgstd/gstd_return_codes.c b/libgstd/gstd_return_codes.c index dd27e768..22cad8e7 100644 --- a/libgstd/gstd_return_codes.c +++ b/libgstd/gstd_return_codes.c @@ -1,28 +1,21 @@ - /* - * Gstreamer Daemon - Gst Launch under steroids - * Copyright (C) 2015-2021 RidgeRun Engineering - * - * This file is part of Gstd. + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * Gstd is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * Gstd is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Gstd. If not, see . - */ - -/** - * \file gstd_return_codes.c + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * Gstreamer Daemon return codes textual description + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include "gstd_return_codes.h" diff --git a/libgstd/gstd_return_codes.h b/libgstd/gstd_return_codes.h index fd1ca8fe..9aed3f3f 100644 --- a/libgstd/gstd_return_codes.h +++ b/libgstd/gstd_return_codes.h @@ -1,21 +1,21 @@ - /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_RETURN_CODES_H__ @@ -29,9 +29,6 @@ #include -typedef enum _GstdReturnCode GstdReturnCode; -const gchar *gstd_return_code_to_string (GstdReturnCode code); - enum _GstdReturnCode { /** @@ -131,5 +128,7 @@ enum _GstdReturnCode }; +typedef enum _GstdReturnCode GstdReturnCode; +const gchar *gstd_return_code_to_string (GstdReturnCode code); #endif //__GSTD_RETURN_CODES_H__ diff --git a/libgstd/gstd_session.c b/libgstd/gstd_session.c index a578107a..3412fa89 100644 --- a/libgstd/gstd_session.c +++ b/libgstd/gstd_session.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/libgstd/gstd_session.h b/libgstd/gstd_session.h index 13b370f6..8f80fdbf 100644 --- a/libgstd/gstd_session.h +++ b/libgstd/gstd_session.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ /** diff --git a/libgstd/gstd_signal.c b/libgstd/gstd_signal.c index a9e48406..5cc6c56c 100644 --- a/libgstd/gstd_signal.c +++ b/libgstd/gstd_signal.c @@ -1,19 +1,21 @@ /* - * Copyright (c) 2019 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/libgstd/gstd_signal.h b/libgstd/gstd_signal.h index 42d4787f..002b5d4e 100644 --- a/libgstd/gstd_signal.h +++ b/libgstd/gstd_signal.h @@ -1,19 +1,21 @@ /* - * Copyright (c) 2019 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_SIGNAL_H__ diff --git a/libgstd/gstd_signal_list.c b/libgstd/gstd_signal_list.c index ba16e99d..61971d5f 100644 --- a/libgstd/gstd_signal_list.c +++ b/libgstd/gstd_signal_list.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2019 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/libgstd/gstd_signal_list.h b/libgstd/gstd_signal_list.h index 1982c095..522cffdc 100644 --- a/libgstd/gstd_signal_list.h +++ b/libgstd/gstd_signal_list.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_SIGNAL_LIST_H__ diff --git a/libgstd/gstd_signal_reader.c b/libgstd/gstd_signal_reader.c index 0fab8d06..16e11251 100644 --- a/libgstd/gstd_signal_reader.c +++ b/libgstd/gstd_signal_reader.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include diff --git a/libgstd/gstd_signal_reader.h b/libgstd/gstd_signal_reader.h index 26d5c1f8..67b60e02 100644 --- a/libgstd/gstd_signal_reader.h +++ b/libgstd/gstd_signal_reader.h @@ -1,19 +1,21 @@ /* - * Copyright (c) 2019 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_SIGNAL_READER_H__ diff --git a/libgstd/gstd_socket.c b/libgstd/gstd_socket.c index 9693bfaa..a0a41fd1 100644 --- a/libgstd/gstd_socket.c +++ b/libgstd/gstd_socket.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2019 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H @@ -23,6 +24,8 @@ #include +#include "gstd_parser.h" + #include "gstd_socket.h" /* Gstd SOCKET debugging category */ diff --git a/libgstd/gstd_socket.h b/libgstd/gstd_socket.h index 87c386f4..32490092 100644 --- a/libgstd/gstd_socket.h +++ b/libgstd/gstd_socket.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2019 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_SOCKET_H__ #define __GSTD_SOCKET_H__ diff --git a/libgstd/gstd_state.c b/libgstd/gstd_state.c index 2c7cf771..68f1d626 100644 --- a/libgstd/gstd_state.c +++ b/libgstd/gstd_state.c @@ -1,21 +1,21 @@ /* - * Gstreamer Daemon - Gst Launch under steroids - * Copyright (C) 2017 RidgeRun Engineering + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This file is part of Gstd. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * Gstd is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Gstd is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public License - * along with Gstd. If not, see . + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H @@ -23,10 +23,13 @@ #endif #include + #include "gstd_state.h" enum { + PROP_0, + PROP_REFCOUNT, N_PROPERTIES }; @@ -36,6 +39,13 @@ struct _GstdState GstState state; GstElement *target; + + /** + * Reference count of pipeline play. It is incremented with pipeline_play_ref + * and decremented with pipeline_stop_ref. When it reaches 0 the pipeline + * is stopped. + */ + guint refcount; }; struct _GstdStateClass @@ -81,6 +91,7 @@ gstd_state_to_string (GstdObject * obj, gchar ** outstring); static GstdReturnCode gstd_state_update (GstdObject * object, const gchar * sstate); static void gstd_state_dispose (GObject * obj); +static void gstd_state_get_property (GObject *, guint, GValue *, GParamSpec *); static GstState gstd_state_read (GstdState * state); static void @@ -91,6 +102,7 @@ gstd_state_class_init (GstdStateClass * klass) guint debug_color; oclass->dispose = gstd_state_dispose; + oclass->get_property = gstd_state_get_property; gstdc->to_string = GST_DEBUG_FUNCPTR (gstd_state_to_string); gstdc->update = GST_DEBUG_FUNCPTR (gstd_state_update); @@ -100,6 +112,29 @@ gstd_state_class_init (GstdStateClass * klass) GST_DEBUG_CATEGORY_INIT (gstd_state_debug, "gstdstate", debug_color, "Gstd State category"); + g_object_class_install_property (oclass, PROP_REFCOUNT, + g_param_spec_int ("refcount", "Reference Count", + "Reference count of pipeline play", 0, G_MAXINT, 0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); +} + +static void +gstd_state_get_property (GObject * object, + guint property_id, GValue * value, GParamSpec * pspec) +{ + GstdState *self = GSTD_STATE (object); + + switch (property_id) { + case PROP_REFCOUNT: + GST_DEBUG_OBJECT (self, "Returning refcount %u", self->refcount); + g_value_set_int (value, self->refcount); + break; + + default: + /* We don't have any other property... */ + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } } static void @@ -108,6 +143,7 @@ gstd_state_init (GstdState * self) GST_INFO_OBJECT (self, "Initializing state"); self->state = GST_STATE_NULL; self->target = NULL; + self->refcount = 0; } static GstdReturnCode @@ -249,3 +285,21 @@ gstd_state_read (GstdState * self) return current; } + +GstdReturnCode +gstd_state_increment_refcount (GstdState * self) +{ + g_return_val_if_fail (self, GSTD_NULL_ARGUMENT); + self->refcount++; + return GSTD_EOK; +} + +GstdReturnCode +gstd_state_decrement_refcount (GstdState * self) +{ + g_return_val_if_fail (self, GSTD_NULL_ARGUMENT); + if (0 < self->refcount) { + self->refcount--; + } + return GSTD_EOK; +} diff --git a/libgstd/gstd_state.h b/libgstd/gstd_state.h index fc5996c3..a450c2fc 100644 --- a/libgstd/gstd_state.h +++ b/libgstd/gstd_state.h @@ -1,21 +1,21 @@ /* - * Gstreamer Daemon - Gst Launch under steroids - * Copyright (C) 2017 RidgeRun Engineering + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This file is part of Gstd. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * Gstd is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Gstd is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public License - * along with Gstd. If not, see . + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_STATE_H__ @@ -24,7 +24,6 @@ #include "gstd_object.h" G_BEGIN_DECLS - /* * Type declaration. */ @@ -40,7 +39,6 @@ G_BEGIN_DECLS (G_TYPE_CHECK_CLASS_TYPE((klass),GSTD_TYPE_STATE)) #define GSTD_STATE_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), GSTD_TYPE_STATE, GstdStateClass)) - typedef struct _GstdState GstdState; typedef struct _GstdStateClass GstdStateClass; @@ -48,6 +46,23 @@ GType gstd_state_get_type (void); GstdState *gstd_state_new (GstElement * target); -G_END_DECLS +/** + * Increment the play refcount stored in the state + * + * \param self GstdState object + * + * \return GstdReturnCode + **/ +GstdReturnCode gstd_state_increment_refcount (GstdState * self); +/** + * Decrement the play refcount stored in the state + * + * \param self GstdState object + * + * \return GstdReturnCode + **/ +GstdReturnCode gstd_state_decrement_refcount (GstdState * self); + +G_END_DECLS #endif // __GSTD_STATE_H__ diff --git a/libgstd/gstd_tcp.c b/libgstd/gstd_tcp.c index 0bfad53f..719ea213 100644 --- a/libgstd/gstd_tcp.c +++ b/libgstd/gstd_tcp.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H @@ -26,12 +27,11 @@ #include #include "gstd_ipc.h" -#include "gstd_tcp.h" -#include "gstd_parser.h" #include "gstd_element.h" #include "gstd_pipeline_bus.h" #include "gstd_event_handler.h" +#include "gstd_tcp.h" /* Gstd TCP debugging category */ GST_DEBUG_CATEGORY_STATIC (gstd_tcp_debug); diff --git a/libgstd/gstd_tcp.h b/libgstd/gstd_tcp.h index 109817b8..3ee7884d 100644 --- a/libgstd/gstd_tcp.h +++ b/libgstd/gstd_tcp.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_TCP_H__ #define __GSTD_TCP_H__ diff --git a/libgstd/gstd_unix.c b/libgstd/gstd_unix.c index bd861185..2bd5047a 100644 --- a/libgstd/gstd_unix.c +++ b/libgstd/gstd_unix.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2019 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/libgstd/gstd_unix.h b/libgstd/gstd_unix.h index b3bb02af..ae33506e 100644 --- a/libgstd/gstd_unix.h +++ b/libgstd/gstd_unix.h @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifndef __GSTD_UNIX_H__ #define __GSTD_UNIX_H__ diff --git a/libgstd/libgstd.c b/libgstd/libgstd.c index 2165c23d..f3d4f0fa 100644 --- a/libgstd/libgstd.c +++ b/libgstd/libgstd.c @@ -1,36 +1,26 @@ /* - * GStreamer Daemon - gst-launch on steroids - * C library abstracting gstd + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * Copyright (c) 2015-2021 RidgeRun, LLC (http://www.ridgerun.com) + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ -#define _GNU_SOURCE +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "gstd.h" @@ -111,10 +101,9 @@ gstd_set_ipc (GstD * gstd) GstdIpc **ipc_array = NULL; g_return_if_fail (NULL != gstd); - g_return_if_fail (NULL != supported_ipcs); /* If there is ipcs, then initialize them */ - if (NULL != supported_ipcs && num_ipcs > 0) { + if (num_ipcs > 0) { ipc_array = g_malloc0 (num_ipcs * sizeof (*ipc_array)); for (gint ipc_idx = 0; ipc_idx < num_ipcs; ipc_idx++) { ipc_array[ipc_idx] = diff --git a/m4/ax_lib_readline.m4 b/m4/ax_lib_readline.m4 deleted file mode 100644 index cab3d71e..00000000 --- a/m4/ax_lib_readline.m4 +++ /dev/null @@ -1,107 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_lib_readline.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_LIB_READLINE -# -# DESCRIPTION -# -# Searches for a readline compatible library. If found, defines -# `HAVE_LIBREADLINE'. If the found library has the `add_history' function, -# sets also `HAVE_READLINE_HISTORY'. Also checks for the locations of the -# necessary include files and sets `HAVE_READLINE_H' or -# `HAVE_READLINE_READLINE_H' and `HAVE_READLINE_HISTORY_H' or -# 'HAVE_HISTORY_H' if the corresponding include files exists. -# -# The libraries that may be readline compatible are `libedit', -# `libeditline' and `libreadline'. Sometimes we need to link a termcap -# library for readline to work, this macro tests these cases too by trying -# to link with `libtermcap', `libcurses' or `libncurses' before giving up. -# -# Here is an example of how to use the information provided by this macro -# to perform the necessary includes or declarations in a C file: -# -# #ifdef HAVE_LIBREADLINE -# # if defined(HAVE_READLINE_READLINE_H) -# # include -# # elif defined(HAVE_READLINE_H) -# # include -# # else /* !defined(HAVE_READLINE_H) */ -# extern char *readline (); -# # endif /* !defined(HAVE_READLINE_H) */ -# char *cmdline = NULL; -# #else /* !defined(HAVE_READLINE_READLINE_H) */ -# /* no readline */ -# #endif /* HAVE_LIBREADLINE */ -# -# #ifdef HAVE_READLINE_HISTORY -# # if defined(HAVE_READLINE_HISTORY_H) -# # include -# # elif defined(HAVE_HISTORY_H) -# # include -# # else /* !defined(HAVE_HISTORY_H) */ -# extern void add_history (); -# extern int write_history (); -# extern int read_history (); -# # endif /* defined(HAVE_READLINE_HISTORY_H) */ -# /* no history */ -# #endif /* HAVE_READLINE_HISTORY */ -# -# LICENSE -# -# Copyright (c) 2008 Ville Laurikari -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 6 - -AU_ALIAS([VL_LIB_READLINE], [AX_LIB_READLINE]) -AC_DEFUN([AX_LIB_READLINE], [ - AC_CACHE_CHECK([for a readline compatible library], - ax_cv_lib_readline, [ - ORIG_LIBS="$LIBS" - for readline_lib in readline edit editline; do - for termcap_lib in "" termcap curses ncurses ncursesw; do - if test -z "$termcap_lib"; then - TRY_LIB="-l$readline_lib" - else - TRY_LIB="-l$readline_lib -l$termcap_lib" - fi - LIBS="$ORIG_LIBS $TRY_LIB" - AC_TRY_LINK_FUNC(readline, ax_cv_lib_readline="$TRY_LIB") - if test -n "$ax_cv_lib_readline"; then - break - fi - done - if test -n "$ax_cv_lib_readline"; then - break - fi - done - if test -z "$ax_cv_lib_readline"; then - ax_cv_lib_readline="no" - fi - LIBS="$ORIG_LIBS" - ]) - - if test "$ax_cv_lib_readline" != "no"; then - LIBS="$LIBS $ax_cv_lib_readline" - AC_DEFINE(HAVE_LIBREADLINE, 1, - [Define if you have a readline compatible library]) - AC_CHECK_HEADERS(readline.h readline/readline.h) - AC_CACHE_CHECK([whether readline supports history], - ax_cv_lib_readline_history, [ - ax_cv_lib_readline_history="no" - AC_TRY_LINK_FUNC(add_history, ax_cv_lib_readline_history="yes") - ]) - if test "$ax_cv_lib_readline_history" = "yes"; then - AC_DEFINE(HAVE_READLINE_HISTORY, 1, - [Define if your readline library has \`add_history']) - AC_CHECK_HEADERS(history.h readline/history.h) - fi - fi -])dnl diff --git a/meson.build b/meson.build index a30f776c..078cd556 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,10 @@ project('gstd', 'c', - version : '0.14.0', - meson_version : '>= 0.50',) + version : '0.15.0', + meson_version : '>= 0.50', + default_options : [ + 'c_std=c11', + ] +) gstd_version = meson.project_version() version_arr = gstd_version.split('.') @@ -23,7 +27,8 @@ json_glib_dep = dependency('json-glib-1.0', version : '>=0.16.2') libd_dep = dependency('libdaemon', version : '>=0.14') jansson_dep = dependency('jansson', version : '>=2.7') thread_dep = dependency('threads') -libsoup_dep = dependency('libsoup-2.4', version : '>=2.4') +libsoup_dep = dependency('libsoup-2.4', version : '>=2.4') +libedit_dep = dependency('libedit', version : '>=3.0') gst_check_required = get_option('enable-tests').enabled() gst_check_dep = dependency('gstreamer-check-1.0', required : gst_check_required, version : '>=1.0.5') @@ -32,25 +37,6 @@ systemd_required = get_option('enable-systemd').enabled() systemd_dep = dependency('systemd', required : systemd_required, version : '>=232') cc = meson.get_compiler('c') -readline = cc.find_library('readline', required: true) -if readline.found() - add_project_arguments('-DHAVE_LIBREADLINE', language: 'c') - add_project_arguments('-DHAVE_READLINE_HISTORY', language: 'c') - # Add arguments to the compiler command line. - if cc.has_header('readline/readline.h') - add_project_arguments('-DHAVE_READLINE_READLINE_H', language: 'c') - else - add_project_arguments('-DHAVE_READLINE_H', language: 'c') - endif - - if cc.has_header('readline/history.h') - add_project_arguments('-DHAVE_READLINE_HISTORY_H', language: 'c') - else - add_project_arguments('-DHAVE_HISTORY_H', language: 'c') - endif - - readline_dep = readline -endif ## Dependencies # Define gst Daemon dependencies @@ -78,7 +64,7 @@ libgstd_deps = [ # Define gst client application dependencies gst_client_deps = [ - readline_dep, + libedit_dep, json_glib_dep, gio_unix_dep ] @@ -283,8 +269,8 @@ pkgconfig = import('pkgconfig') # Install git hooks run_command('rm', '-f', '.git/hooks/pre-commit', -'.git/hooks/pre-commit') -r = run_command('ln', '-s', '../../common/hooks/pre-commit.hook', '.git/hooks/pre-commit') +'.git/hooks/pre-commit', check: false) +r = run_command('ln', '-s', '../../common/hooks/pre-commit.hook', '.git/hooks/pre-commit', check: false) if r.returncode() != 0 warning('Failed to create commit hook') endif @@ -292,6 +278,8 @@ endif # Meson will generate a header file all the entries in the configuration data object configure_file(output : 'config.h', configuration : cdata) +add_project_arguments(['-D_GNU_SOURCE'], language: 'c') + # Enter to each subdirectory and execute the meson.build subdir('libgstc') subdir('libgstd') @@ -300,3 +288,4 @@ subdir('gst_client') subdir('tests') subdir('examples') subdir('docs') +subdir('init') diff --git a/meson_options.txt b/meson_options.txt index f50e540c..25292e6b 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -4,6 +4,7 @@ option('enable-examples', type : 'feature', value : 'auto', yield : true, descri option('enable-gtk-doc', type : 'boolean', value : false, description : 'Use gtk-doc to build documentation') option('enable-systemd', type : 'feature', value : 'auto', description : 'Enable systemd gstd.service install') option('enable-initd', type : 'feature', value : 'disabled', description : 'Enable init script install') +option('enable-python', type : 'feature', value : 'auto', description : 'Install the pygstc library') # String options option('with-gstd-runstatedir', type : 'string', value : '${prefix}/var/run/gstd', description : 'Specify the location of the gstd\'s PID file') @@ -11,6 +12,7 @@ option('with-gstd-logstatedir', type : 'string', value : '${prefix}/var/log/gstd option('with-gstd-systemddir', type : 'string', value : 'Systemd default systemduserunitdir', description : 'Specify the location of gstd.service file') option('with-gstd-initddir', type : 'string', value : '${sysconfdir}/init.d', description : 'Specify the location of gstd init script') option('with-statedir-owner', type : 'string', value : 'root', description : 'Specify the owner of gstd\'s run and log dirs created by the initd script') +option('with-python-version', type : 'string', value : 'python3', description : 'Specify the python version for pygstc installation') # Common options option('package-name', type : 'string', yield : true, diff --git a/tests/Makefile.am b/tests/Makefile.am index a4065292..c774dba7 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -2,4 +2,3 @@ SUBDIRS = \ gstd \ libgstd \ libgstc - \ No newline at end of file diff --git a/tests/gstd/Makefile.am b/tests/gstd/Makefile.am index 1bb186e2..7a4d082c 100644 --- a/tests/gstd/Makefile.am +++ b/tests/gstd/Makefile.am @@ -4,6 +4,6 @@ TESTS = test_gstd_pipeline_create \ check_PROGRAMS = $(TESTS) -AM_CFLAGS = $(GST_CFLAGS) -I$(top_srcdir)/libgstd/ -AM_LDFLAGS = $(GST_LIBS) +AM_CFLAGS = $(GSTD_CFLAGS) $(GST_CFLAGS) -I$(top_srcdir)/libgstd/ +AM_LDFLAGS = $(GSTD_LIBS) $(GST_LIBS) LDADD = $(top_srcdir)/libgstd/libgstd-1.0.la diff --git a/tests/gstd/test_gstd_no_create.c b/tests/gstd/test_gstd_no_create.c index cb1b2799..ed324c03 100644 --- a/tests/gstd/test_gstd_no_create.c +++ b/tests/gstd/test_gstd_no_create.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/tests/gstd/test_gstd_pipeline_create.c b/tests/gstd/test_gstd_pipeline_create.c index 29ebf6b1..049b105d 100644 --- a/tests/gstd/test_gstd_pipeline_create.c +++ b/tests/gstd/test_gstd_pipeline_create.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/tests/gstd/test_gstd_session.c b/tests/gstd/test_gstd_session.c index d96b12d5..32db9f59 100644 --- a/tests/gstd/test_gstd_session.c +++ b/tests/gstd/test_gstd_session.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ diff --git a/tests/gstd/test_gstd_state.c b/tests/gstd/test_gstd_state.c index 8ef3fc57..5ea3b51b 100644 --- a/tests/gstd/test_gstd_state.c +++ b/tests/gstd/test_gstd_state.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2017 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H diff --git a/tests/libgstc/Makefile.am b/tests/libgstc/Makefile.am index 389acd78..08c271f2 100644 --- a/tests/libgstc/Makefile.am +++ b/tests/libgstc/Makefile.am @@ -1,5 +1 @@ -SUBDIRS=c - -# FIXME Disable pygstc checks -#SUBDIRS = python - +SUBDIRS=c python diff --git a/tests/libgstc/c/Makefile.am b/tests/libgstc/c/Makefile.am index 535c43bf..0048ed7a 100644 --- a/tests/libgstc/c/Makefile.am +++ b/tests/libgstc/c/Makefile.am @@ -29,8 +29,8 @@ TESTS = \ check_PROGRAMS = $(TESTS) -AM_CFLAGS = $(GST_CFLAGS) $(JANSSON_CFLAGS) $(GIO_CFLAGS) -I$(top_srcdir)/libgstc/c -AM_LDFLAGS = $(GST_LIBS) $(JANSSON_LIBS) $(GIO_LIBS) +AM_CFLAGS = $(GSTD_CFLAGS) $(GST_CFLAGS) $(JANSSON_CFLAGS) $(GIO_CFLAGS) -I$(top_srcdir)/libgstc/c +AM_LDFLAGS = $(GSTD_LIBS) $(GST_LIBS) $(JANSSON_LIBS) $(GIO_LIBS) COMMON_SOURCES = \ @top_srcdir@/libgstc/c/libgstc_assert.c \ @@ -126,9 +126,9 @@ libgstc_pipeline_list_SOURCES = \ $(COMMON_SOURCES) libgstc_pipeline_seek_SOURCES = \ - test_libgstc_pipeline_seek.c \ + test_libgstc_pipeline_seek.c \ @top_srcdir@/libgstc/c/libgstc.c \ - $(COMMON_SOURCES) + $(COMMON_SOURCES) libgstc_debug_SOURCES = \ test_libgstc_debug.c \ diff --git a/tests/libgstc/c/test_libgstc_client.c b/tests/libgstc/c/test_libgstc_client.c index 910618f7..9c3c0df9 100644 --- a/tests/libgstc/c/test_libgstc_client.c +++ b/tests/libgstc/c/test_libgstc_client.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2018 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include diff --git a/tests/libgstc/c/test_libgstc_debug.c b/tests/libgstc/c/test_libgstc_debug.c index 0668e332..ae777b51 100644 --- a/tests/libgstc/c/test_libgstc_debug.c +++ b/tests/libgstc/c/test_libgstc_debug.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2018 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include #include diff --git a/tests/libgstc/c/test_libgstc_element_get.c b/tests/libgstc/c/test_libgstc_element_get.c index 535aad31..07506eec 100644 --- a/tests/libgstc/c/test_libgstc_element_get.c +++ b/tests/libgstc/c/test_libgstc_element_get.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2018 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include #include diff --git a/tests/libgstc/c/test_libgstc_element_set.c b/tests/libgstc/c/test_libgstc_element_set.c index 53dd266f..f85f1a3e 100644 --- a/tests/libgstc/c/test_libgstc_element_set.c +++ b/tests/libgstc/c/test_libgstc_element_set.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2018 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include #include diff --git a/tests/libgstc/c/test_libgstc_json.c b/tests/libgstc/c/test_libgstc_json.c index b4a3df72..748d906f 100644 --- a/tests/libgstc/c/test_libgstc_json.c +++ b/tests/libgstc/c/test_libgstc_json.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2018 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include diff --git a/tests/libgstc/c/test_libgstc_ping.c b/tests/libgstc/c/test_libgstc_ping.c index 48316dc6..faf1a0ed 100644 --- a/tests/libgstc/c/test_libgstc_ping.c +++ b/tests/libgstc/c/test_libgstc_ping.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2018 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include #include diff --git a/tests/libgstc/c/test_libgstc_pipeline_bus_wait.c b/tests/libgstc/c/test_libgstc_pipeline_bus_wait.c index e2f0c589..45989afe 100644 --- a/tests/libgstc/c/test_libgstc_pipeline_bus_wait.c +++ b/tests/libgstc/c/test_libgstc_pipeline_bus_wait.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2018 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include #include diff --git a/tests/libgstc/c/test_libgstc_pipeline_bus_wait_async.c b/tests/libgstc/c/test_libgstc_pipeline_bus_wait_async.c index e9f8046d..d4507a50 100644 --- a/tests/libgstc/c/test_libgstc_pipeline_bus_wait_async.c +++ b/tests/libgstc/c/test_libgstc_pipeline_bus_wait_async.c @@ -1,23 +1,23 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2018 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include -#include #include #include #include @@ -31,7 +31,7 @@ /* Test Fixture */ static gchar _request[3][512]; static GstClient *_client; -pthread_mutex_t lock; +static GMutex lock; int socket_send_wait_time = 0; static void @@ -130,7 +130,7 @@ callback (GstClient * _client, const gchar * pipeline_name, gpointer user_data) { /* Unlock the mutex */ - pthread_mutex_unlock (&lock); + g_mutex_unlock (&lock); return GSTC_OK; } @@ -145,20 +145,12 @@ GST_START_TEST (test_pipeline_bus_wait_async_success) "read /pipelines/pipe/bus/message" }; - /* Mutex timeout 10ms */ - struct timespec ts; - clock_gettime (CLOCK_REALTIME, &ts); - ts.tv_nsec += 10 * 1000000; - - if (pthread_mutex_init (&lock, NULL) != 0) { - /* Exit if unable to create mutex lock */ - ASSERT_CRITICAL (); - } + g_mutex_init (&lock); /* * Lock the mutex, this should be unlocked by the callback function */ - pthread_mutex_lock (&lock); + g_mutex_lock (&lock); ret = gstc_pipeline_bus_wait_async (_client, pipeline_name, message_name, @@ -169,56 +161,9 @@ GST_START_TEST (test_pipeline_bus_wait_async_success) assert_equals_string (expected[1], _request[1]); /* Wait for the callback function to finish or timeout passes */ - pthread_mutex_timedlock (&lock, &ts); + g_mutex_lock (&lock); assert_equals_string (expected[2], _request[2]); - pthread_mutex_unlock (&lock); -} - -GST_END_TEST; - -GST_START_TEST (test_pipeline_bus_wait_async_bus_didnt_respond) -{ - GstcStatus ret; - const gchar *pipeline_name = "pipe"; - const gchar *message_name = "eos"; - const gint64 timeout = -1; - const gchar *expected[] = { "update /pipelines/pipe/bus/types eos", - "update /pipelines/pipe/bus/timeout -1" - }; - struct timespec ts; - /* Set the send command to wait for 1s before responding */ - socket_send_wait_time = 1; - - /* Mutex timeout 10ms */ - clock_gettime (CLOCK_REALTIME, &ts); - ts.tv_sec += 0; - ts.tv_nsec += 10 * 1000000; - - if (pthread_mutex_init (&lock, NULL) != 0) { - /* Exit if unable to create mutex lock */ - ASSERT_CRITICAL (); - } - - /* - * Lock the mutex, this should be unlocked by the callback function - */ - pthread_mutex_lock (&lock); - - ret = - gstc_pipeline_bus_wait_async (_client, pipeline_name, message_name, - timeout, callback, NULL); - assert_equals_int (GSTC_OK, ret); - - assert_equals_string (expected[0], _request[0]); - assert_equals_string (expected[1], _request[1]); - - /* Wait for the callback function to finish or timeout passes */ - pthread_mutex_timedlock (&lock, &ts); - assert_equals_string ("", _request[2]); - pthread_mutex_unlock (&lock); - - /* Reset value */ - socket_send_wait_time = 0; + g_mutex_unlock (&lock); } GST_END_TEST; @@ -233,7 +178,6 @@ libgstc_pipeline_bus_wait_async_suite (void) tcase_add_checked_fixture (tc, setup, teardown); tcase_add_test (tc, test_pipeline_bus_wait_async_success); - tcase_add_test (tc, test_pipeline_bus_wait_async_bus_didnt_respond); return suite; } diff --git a/tests/libgstc/c/test_libgstc_pipeline_create.c b/tests/libgstc/c/test_libgstc_pipeline_create.c index 6a6e15f5..509fcc65 100644 --- a/tests/libgstc/c/test_libgstc_pipeline_create.c +++ b/tests/libgstc/c/test_libgstc_pipeline_create.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2018 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include #include diff --git a/tests/libgstc/c/test_libgstc_pipeline_delete.c b/tests/libgstc/c/test_libgstc_pipeline_delete.c index d3e11254..90dfe6f8 100644 --- a/tests/libgstc/c/test_libgstc_pipeline_delete.c +++ b/tests/libgstc/c/test_libgstc_pipeline_delete.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2018 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include #include diff --git a/tests/libgstc/c/test_libgstc_pipeline_flush_start.c b/tests/libgstc/c/test_libgstc_pipeline_flush_start.c index 351e304a..b695e93a 100644 --- a/tests/libgstc/c/test_libgstc_pipeline_flush_start.c +++ b/tests/libgstc/c/test_libgstc_pipeline_flush_start.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2018 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include #include diff --git a/tests/libgstc/c/test_libgstc_pipeline_flush_stop.c b/tests/libgstc/c/test_libgstc_pipeline_flush_stop.c index 2a698c87..57397e1d 100644 --- a/tests/libgstc/c/test_libgstc_pipeline_flush_stop.c +++ b/tests/libgstc/c/test_libgstc_pipeline_flush_stop.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2018 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include #include diff --git a/tests/libgstc/c/test_libgstc_pipeline_get_graph.c b/tests/libgstc/c/test_libgstc_pipeline_get_graph.c index fba8f97a..0be3aab6 100644 --- a/tests/libgstc/c/test_libgstc_pipeline_get_graph.c +++ b/tests/libgstc/c/test_libgstc_pipeline_get_graph.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2018 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include #include diff --git a/tests/libgstc/c/test_libgstc_pipeline_get_state.c b/tests/libgstc/c/test_libgstc_pipeline_get_state.c index 463266cd..63279920 100644 --- a/tests/libgstc/c/test_libgstc_pipeline_get_state.c +++ b/tests/libgstc/c/test_libgstc_pipeline_get_state.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2021 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include #include diff --git a/tests/libgstc/c/test_libgstc_pipeline_inject_eos.c b/tests/libgstc/c/test_libgstc_pipeline_inject_eos.c index 3bc6c05e..fce74269 100644 --- a/tests/libgstc/c/test_libgstc_pipeline_inject_eos.c +++ b/tests/libgstc/c/test_libgstc_pipeline_inject_eos.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2018 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include #include diff --git a/tests/libgstc/c/test_libgstc_pipeline_list.c b/tests/libgstc/c/test_libgstc_pipeline_list.c index 01ce1db1..a017845e 100644 --- a/tests/libgstc/c/test_libgstc_pipeline_list.c +++ b/tests/libgstc/c/test_libgstc_pipeline_list.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2018 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include #include diff --git a/tests/libgstc/c/test_libgstc_pipeline_list_elements.c b/tests/libgstc/c/test_libgstc_pipeline_list_elements.c index 4f3cf2b5..c27b534b 100644 --- a/tests/libgstc/c/test_libgstc_pipeline_list_elements.c +++ b/tests/libgstc/c/test_libgstc_pipeline_list_elements.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2018 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include #include diff --git a/tests/libgstc/c/test_libgstc_pipeline_list_properties.c b/tests/libgstc/c/test_libgstc_pipeline_list_properties.c index fb77ea0a..b926513a 100644 --- a/tests/libgstc/c/test_libgstc_pipeline_list_properties.c +++ b/tests/libgstc/c/test_libgstc_pipeline_list_properties.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2018 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include #include diff --git a/tests/libgstc/c/test_libgstc_pipeline_list_signals.c b/tests/libgstc/c/test_libgstc_pipeline_list_signals.c index aa13b7f5..92f4ac1f 100644 --- a/tests/libgstc/c/test_libgstc_pipeline_list_signals.c +++ b/tests/libgstc/c/test_libgstc_pipeline_list_signals.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2021 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include #include diff --git a/tests/libgstc/c/test_libgstc_pipeline_pause.c b/tests/libgstc/c/test_libgstc_pipeline_pause.c index 3d3868e6..5e26d78b 100644 --- a/tests/libgstc/c/test_libgstc_pipeline_pause.c +++ b/tests/libgstc/c/test_libgstc_pipeline_pause.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2018 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include #include diff --git a/tests/libgstc/c/test_libgstc_pipeline_play.c b/tests/libgstc/c/test_libgstc_pipeline_play.c index f7e920e7..c8ca5ea9 100644 --- a/tests/libgstc/c/test_libgstc_pipeline_play.c +++ b/tests/libgstc/c/test_libgstc_pipeline_play.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2018 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include #include diff --git a/tests/libgstc/c/test_libgstc_pipeline_seek.c b/tests/libgstc/c/test_libgstc_pipeline_seek.c index 00ad2f40..3d5e2633 100644 --- a/tests/libgstc/c/test_libgstc_pipeline_seek.c +++ b/tests/libgstc/c/test_libgstc_pipeline_seek.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2018 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include #include diff --git a/tests/libgstc/c/test_libgstc_pipeline_signal_connect.c b/tests/libgstc/c/test_libgstc_pipeline_signal_connect.c index b46a5770..ad8d3a8f 100644 --- a/tests/libgstc/c/test_libgstc_pipeline_signal_connect.c +++ b/tests/libgstc/c/test_libgstc_pipeline_signal_connect.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2021 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include #include diff --git a/tests/libgstc/c/test_libgstc_pipeline_signal_disconnect.c b/tests/libgstc/c/test_libgstc_pipeline_signal_disconnect.c index 2bff7773..9d8227c6 100644 --- a/tests/libgstc/c/test_libgstc_pipeline_signal_disconnect.c +++ b/tests/libgstc/c/test_libgstc_pipeline_signal_disconnect.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2021 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include #include diff --git a/tests/libgstc/c/test_libgstc_pipeline_stop.c b/tests/libgstc/c/test_libgstc_pipeline_stop.c index 1a724a99..4597bf2f 100644 --- a/tests/libgstc/c/test_libgstc_pipeline_stop.c +++ b/tests/libgstc/c/test_libgstc_pipeline_stop.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2018 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include #include diff --git a/tests/libgstc/c/test_libgstc_pipeline_verbose.c b/tests/libgstc/c/test_libgstc_pipeline_verbose.c index 339da90d..fcfc5091 100644 --- a/tests/libgstc/c/test_libgstc_pipeline_verbose.c +++ b/tests/libgstc/c/test_libgstc_pipeline_verbose.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2018 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include #include diff --git a/tests/libgstc/c/test_libgstc_socket.c b/tests/libgstc/c/test_libgstc_socket.c index af42f7b2..f247ae69 100644 --- a/tests/libgstc/c/test_libgstc_socket.c +++ b/tests/libgstc/c/test_libgstc_socket.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2018 Ridgerun, LLC (http://www.ridgerun.com) + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include #include @@ -166,7 +167,7 @@ GST_START_TEST (test_socket_success_keep_open) const gint keep_open = TRUE; const gchar *request = "ping"; const gchar *expected = "pong"; - gchar *response; + gchar *response = NULL; ret = gstc_socket_new (address, port, keep_open, &socket); assert_equals_int (GSTC_OK, ret); @@ -194,7 +195,7 @@ GST_START_TEST (test_socket_timeout_sucess) const gint keep_open = TRUE; const gchar *request = "ping"; const gchar *expected = "pong"; - gchar *response; + gchar *response = NULL; socket_delay = 100; ret = gstc_socket_new (address, port, keep_open, &socket); @@ -224,7 +225,7 @@ GST_START_TEST (test_socket_timeout_reached) const gint keep_open = TRUE; const gchar *request = "ping"; const gchar *expected = "pong"; - gchar *response; + gchar *response = NULL; socket_delay = 100; ret = gstc_socket_new (address, port, keep_open, &socket); @@ -252,7 +253,7 @@ GST_START_TEST (test_socket_success_keep_closed) const gint keep_open = FALSE; const gchar *request = "ping"; const gchar *expected = "pong"; - gchar *response; + gchar *response = NULL; int socket_errno; ret = gstc_socket_new (address, port, keep_open, &gstc_socket); @@ -297,7 +298,7 @@ GST_START_TEST (test_socket_persistent) const gint keep_open = TRUE; const gchar *request = "ping"; const gchar *expected = "pong"; - gchar *response; + gchar *response = NULL; ret = gstc_socket_new (address, port, keep_open, &socket); assert_equals_int (GSTC_OK, ret); @@ -387,7 +388,7 @@ GST_START_TEST (test_socket_null_socket) GstcStatus ret; const gchar *request = "ping"; const int timeout = -1; - gchar *response; + gchar *response = NULL; ret = gstc_socket_send (NULL, request, &response, timeout); assert_equals_int (GSTC_NULL_ARGUMENT, ret); @@ -404,7 +405,7 @@ GST_START_TEST (test_socket_null_request) const int timeout = -1; const gint keep_open = TRUE; const gchar *request = NULL; - gchar *response; + gchar *response = NULL; ret = gstc_socket_new (address, port, keep_open, &socket); assert_equals_int (GSTC_OK, ret); @@ -448,8 +449,8 @@ GST_START_TEST (test_socket_long_response) const gint keep_open = FALSE; const gchar *request = "ping"; gchar *expected; - gint size = 1024*1024; - gchar *response; + gint size = 1024 * 1024; + gchar *response = NULL; int i = 0; ret = gstc_socket_new (address, port, keep_open, &gstc_socket); @@ -458,10 +459,10 @@ GST_START_TEST (test_socket_long_response) expected = g_malloc (size); for (i = 0; i < size; ++i) { - expected[i] = 'a' + (i%10); + expected[i] = 'a' + (i % 10); } expected[size - 1] = '\0'; - + _mock_expected = expected; ret = gstc_socket_send (gstc_socket, request, &response, wait_time); diff --git a/tests/libgstc/python/Makefile.am b/tests/libgstc/python/Makefile.am index 44f0ddac..e89cd999 100644 --- a/tests/libgstc/python/Makefile.am +++ b/tests/libgstc/python/Makefile.am @@ -29,4 +29,6 @@ TESTS = \ test_libgstc_python_update.py \ test_libgstc_python_stop_gstd.py -export PYTHONPATH = $PYTHONPATH:$(top_srcdir)/libgstc +check_SCRIPTS = $(TESTS) + +export PYTHONPATH = $PYTHONPATH:$(top_srcdir)/libgstc/python diff --git a/tests/libgstc/python/gstd_runner.py b/tests/libgstc/python/gstd_runner.py new file mode 100644 index 00000000..87183303 --- /dev/null +++ b/tests/libgstc/python/gstd_runner.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python3 +# GStreamer Daemon - gst-launch on steroids +# Python client library abstracting gstd interprocess communication + +# Copyright (c) 2015-2022 RidgeRun, LLC (http://www.ridgerun.com) + +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: + +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. + +# 2. Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. + +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +# OF THE POSSIBILITY OF SUCH DAMAGE. + +import pathlib +import socket +import subprocess +import unittest + + +DEFAULT_TEAR_DOWN_TIMEOUT = 1 + +class GstdTestRunner(unittest.TestCase): + + def get_open_port(self): + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + s.bind(("",0)) + s.listen(1) + port = s.getsockname()[1] + s.close() + return port + + def setUp(self): + self.port = self.get_open_port() + self.gstd_path = (pathlib.Path(__file__).parent.parent.parent.parent + .joinpath('gstd').joinpath('gstd').resolve()) + self.gstd = subprocess.Popen([self.gstd_path, '-p', str(self.port)]) + connected = -1 + while connected != 0: + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + connected = sock.connect_ex(("", self.port)) + sock.close() + + def tearDown(self): + self.gstd.terminate() + try: + self.gstd.wait(DEFAULT_TEAR_DOWN_TIMEOUT) + except subprocess.TimeoutExpired: + self.gstd.kill() + self.gstd.wait() + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/libgstc/python/test_libgstc_python_bus_filter.py b/tests/libgstc/python/test_libgstc_python_bus_filter.py index e86ed131..68dbdfba 100755 --- a/tests/libgstc/python/test_libgstc_python_bus_filter.py +++ b/tests/libgstc/python/test_libgstc_python_bus_filter.py @@ -31,16 +31,17 @@ import unittest +from gstd_runner import GstdTestRunner from pygstc.gstc import * from pygstc.logger import * -class TestGstcBusFilterMethods(unittest.TestCase): +class TestGstcBusFilterMethods(GstdTestRunner): def test_bus_filter_eos(self): pipeline = 'videotestsrc name=v0 ! fakesink' self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.pipeline_create('p0', pipeline) self.gstd_client.pipeline_play('p0') self.gstd_client.event_eos('p0') diff --git a/tests/libgstc/python/test_libgstc_python_bus_timeout.py b/tests/libgstc/python/test_libgstc_python_bus_timeout.py index 8c72644d..2ee9f4a6 100755 --- a/tests/libgstc/python/test_libgstc_python_bus_timeout.py +++ b/tests/libgstc/python/test_libgstc_python_bus_timeout.py @@ -31,30 +31,32 @@ import unittest +from gstd_runner import GstdTestRunner from pygstc.gstc import * from pygstc.logger import * -class TestGstcBusTimeoutMethods(unittest.TestCase): +class TestGstcBusTimeoutMethods(GstdTestRunner): def test_bus_timeout_eos(self): pipeline = 'videotestsrc name=v0 ! fakesink' self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.pipeline_create('p0', pipeline) self.gstd_client.pipeline_play('p0') self.gstd_client.event_eos('p0') self.gstd_client.bus_filter('p0', 'eos') self.gstd_client.bus_timeout('p0', 1000) ret = self.gstd_client.bus_read('p0') - self.assertEqual(ret['type'], 'eos') + if ret: + self.assertEqual(ret['type'], 'eos') self.gstd_client.pipeline_stop('p0') self.gstd_client.pipeline_delete('p0') def test_bus_timeout_no_response(self): pipeline = 'videotestsrc name=v0 ! fakesink' self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.pipeline_create('p0', pipeline) self.gstd_client.pipeline_play('p0') self.gstd_client.bus_timeout('p0', 1000) diff --git a/tests/libgstc/python/test_libgstc_python_create.py b/tests/libgstc/python/test_libgstc_python_create.py index c35a0437..36c87b83 100755 --- a/tests/libgstc/python/test_libgstc_python_create.py +++ b/tests/libgstc/python/test_libgstc_python_create.py @@ -31,16 +31,17 @@ import unittest +from gstd_runner import GstdTestRunner from pygstc.gstc import * from pygstc.logger import * -class TestGstcCreateMethods(unittest.TestCase): +class TestGstcCreateMethods(GstdTestRunner): def test_create_pipeline(self): pipeline = 'videotestsrc name=v0 ! fakesink' self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) ret = self.gstd_client.read('pipelines') initial_n_pipes = len(ret['nodes']) self.gstd_client.create('pipelines', 'p0', pipeline) @@ -52,7 +53,7 @@ def test_create_pipeline(self): def test_create_bad_pipeline(self): pipeline = 'source sink' self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) with self.assertRaises(GstdError): self.gstd_client.create('pipelines', 'p0', pipeline) diff --git a/tests/libgstc/python/test_libgstc_python_debug_color.py b/tests/libgstc/python/test_libgstc_python_debug_color.py index 46f33319..f0c17803 100755 --- a/tests/libgstc/python/test_libgstc_python_debug_color.py +++ b/tests/libgstc/python/test_libgstc_python_debug_color.py @@ -31,20 +31,21 @@ import unittest +from gstd_runner import GstdTestRunner from pygstc.gstc import * from pygstc.logger import * -class TestGstcDebugColorMethods(unittest.TestCase): +class TestGstcDebugColorMethods(GstdTestRunner): def test_debug_color_true(self): self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.debug_color(True) def test_debug_color_false(self): self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.debug_color(False) diff --git a/tests/libgstc/python/test_libgstc_python_debug_enable.py b/tests/libgstc/python/test_libgstc_python_debug_enable.py index cee836ad..92f4725c 100755 --- a/tests/libgstc/python/test_libgstc_python_debug_enable.py +++ b/tests/libgstc/python/test_libgstc_python_debug_enable.py @@ -31,20 +31,21 @@ import unittest +from gstd_runner import GstdTestRunner from pygstc.gstc import * from pygstc.logger import * -class TestGstcDebugEnableMethods(unittest.TestCase): +class TestGstcDebugEnableMethods(GstdTestRunner): def test_debug_enable_true(self): self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.debug_enable(True) def test_debug_enable_false(self): self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.debug_enable(False) diff --git a/tests/libgstc/python/test_libgstc_python_debug_reset.py b/tests/libgstc/python/test_libgstc_python_debug_reset.py index 6fd315f7..db1abf64 100755 --- a/tests/libgstc/python/test_libgstc_python_debug_reset.py +++ b/tests/libgstc/python/test_libgstc_python_debug_reset.py @@ -31,20 +31,21 @@ import unittest +from gstd_runner import GstdTestRunner from pygstc.gstc import * from pygstc.logger import * -class TestGstcDebugResetMethods(unittest.TestCase): +class TestGstcDebugResetMethods(GstdTestRunner): def test_debug_reset_true(self): self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.debug_reset(True) def test_debug_reset_false(self): self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.debug_reset(False) diff --git a/tests/libgstc/python/test_libgstc_python_debug_threshold.py b/tests/libgstc/python/test_libgstc_python_debug_threshold.py index b2b9dda2..e0a2c4bc 100755 --- a/tests/libgstc/python/test_libgstc_python_debug_threshold.py +++ b/tests/libgstc/python/test_libgstc_python_debug_threshold.py @@ -30,60 +30,61 @@ # OF THE POSSIBILITY OF SUCH DAMAGE. import unittest +from gstd_runner import GstdTestRunner from pygstc.gstc import * from pygstc.logger import * -class TestGstcDebugThresholdMethods(unittest.TestCase): +class TestGstcDebugThresholdMethods(GstdTestRunner): def test_debug_threshold_none(self): self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.debug_threshold('0') def test_debug_threshold_error(self): self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.debug_threshold('1') def test_debug_threshold_warning(self): self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.debug_threshold('2') def test_debug_threshold_fixme(self): self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.debug_threshold('3') def test_debug_threshold_info(self): self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.debug_threshold('4') def test_debug_threshold_debug(self): self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.debug_threshold('5') def test_debug_threshold_log(self): self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.debug_threshold('6') def test_debug_threshold_trace(self): self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.debug_threshold('7') def test_debug_threshold_memdump(self): self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.debug_threshold('8') def test_debug_threshold_invalid(self): self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.debug_threshold('9') diff --git a/tests/libgstc/python/test_libgstc_python_delete.py b/tests/libgstc/python/test_libgstc_python_delete.py index 8193f707..67ba4879 100755 --- a/tests/libgstc/python/test_libgstc_python_delete.py +++ b/tests/libgstc/python/test_libgstc_python_delete.py @@ -31,16 +31,17 @@ import unittest +from gstd_runner import GstdTestRunner from pygstc.gstc import * from pygstc.logger import * -class TestGstcDeleteMethods(unittest.TestCase): +class TestGstcDeleteMethods(GstdTestRunner): def test_delete_pipeline(self): pipeline = 'videotestsrc name=v0 ! fakesink' self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) ret = self.gstd_client.read('pipelines') initial_n_pipes = len(ret['nodes']) self.gstd_client.create('pipelines', 'p0', pipeline) diff --git a/tests/libgstc/python/test_libgstc_python_element_get.py b/tests/libgstc/python/test_libgstc_python_element_get.py index 54f33c82..7457057f 100755 --- a/tests/libgstc/python/test_libgstc_python_element_get.py +++ b/tests/libgstc/python/test_libgstc_python_element_get.py @@ -31,23 +31,24 @@ import unittest +from gstd_runner import GstdTestRunner from pygstc.gstc import * from pygstc.logger import * -class TestGstcElementGetMethods(unittest.TestCase): +class TestGstcElementGetMethods(GstdTestRunner): def test_element_get_property_value(self): pipeline = 'videotestsrc name=v0 pattern=ball ! fakesink' self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.pipeline_create('p0', pipeline) - self.assertEqual( + self.assertIn( self.gstd_client.element_get( 'p0', 'v0', 'pattern'), - 'Moving ball') + ['Moving ball', 'ball']) self.gstd_client.pipeline_delete('p0') diff --git a/tests/libgstc/python/test_libgstc_python_element_set.py b/tests/libgstc/python/test_libgstc_python_element_set.py index 959350f0..4fb99ca1 100755 --- a/tests/libgstc/python/test_libgstc_python_element_set.py +++ b/tests/libgstc/python/test_libgstc_python_element_set.py @@ -31,26 +31,27 @@ import unittest +from gstd_runner import GstdTestRunner from pygstc.gstc import * from pygstc.logger import * -class TestGstcElementSetMethods(unittest.TestCase): +class TestGstcElementSetMethods(GstdTestRunner): def test_element_set_property_value(self): pipeline = 'videotestsrc name=v0 pattern=ball ! fakesink' self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.pipeline_create('p0', pipeline) - self.assertEqual( + self.assertIn( self.gstd_client.element_get( 'p0', 'v0', 'pattern'), - 'Moving ball') + ['Moving ball', 'ball']) self.gstd_client.element_set('p0', 'v0', 'pattern', 'bar') - self.assertEqual(self.gstd_client.element_get('p0', 'v0', - 'pattern'), 'Bar') + self.assertIn(self.gstd_client.element_get('p0', 'v0', + 'pattern'), ['Bar', 'bar']) self.gstd_client.pipeline_delete('p0') diff --git a/tests/libgstc/python/test_libgstc_python_event_eos.py b/tests/libgstc/python/test_libgstc_python_event_eos.py index 7666f702..2fe79393 100755 --- a/tests/libgstc/python/test_libgstc_python_event_eos.py +++ b/tests/libgstc/python/test_libgstc_python_event_eos.py @@ -31,16 +31,17 @@ import unittest +from gstd_runner import GstdTestRunner from pygstc.gstc import * from pygstc.logger import * -class TestGstcEventEosMethods(unittest.TestCase): +class TestGstcEventEosMethods(GstdTestRunner): def test_event_eos(self): pipeline = 'videotestsrc name=v0 ! fakesink' self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.pipeline_create('p0', pipeline) self.gstd_client.pipeline_play('p0') self.gstd_client.event_eos('p0') diff --git a/tests/libgstc/python/test_libgstc_python_event_flush_start.py b/tests/libgstc/python/test_libgstc_python_event_flush_start.py index e4128313..8e9e66a6 100755 --- a/tests/libgstc/python/test_libgstc_python_event_flush_start.py +++ b/tests/libgstc/python/test_libgstc_python_event_flush_start.py @@ -31,16 +31,17 @@ import unittest +from gstd_runner import GstdTestRunner from pygstc.gstc import * from pygstc.logger import * -class TestGstcEventFlushStartMethods(unittest.TestCase): +class TestGstcEventFlushStartMethods(GstdTestRunner): def test_event_flush_start(self): pipeline = 'videotestsrc name=v0 ! fakesink' self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.pipeline_create('p0', pipeline) self.gstd_client.pipeline_play('p0') self.gstd_client.event_flush_start('p0') diff --git a/tests/libgstc/python/test_libgstc_python_event_seek.py b/tests/libgstc/python/test_libgstc_python_event_seek.py index 0b4e656d..89505e64 100755 --- a/tests/libgstc/python/test_libgstc_python_event_seek.py +++ b/tests/libgstc/python/test_libgstc_python_event_seek.py @@ -31,16 +31,17 @@ import unittest +from gstd_runner import GstdTestRunner from pygstc.gstc import * from pygstc.logger import * -class TestGstcEventSeekMethods(unittest.TestCase): +class TestGstcEventSeekMethods(GstdTestRunner): def test_event_seek(self): pipeline = 'videotestsrc name=v0 ! fakesink' self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.pipeline_create('p0', pipeline) self.gstd_client.pipeline_play('p0') self.gstd_client.event_seek('p0') diff --git a/tests/libgstc/python/test_libgstc_python_init.py b/tests/libgstc/python/test_libgstc_python_init.py index 665972b7..8309f3d7 100755 --- a/tests/libgstc/python/test_libgstc_python_init.py +++ b/tests/libgstc/python/test_libgstc_python_init.py @@ -30,24 +30,21 @@ # OF THE POSSIBILITY OF SUCH DAMAGE. import os -import subprocess import unittest +from gstd_runner import GstdTestRunner from pygstc.gstc import * from pygstc.logger import * -class TestGstcInitMethods(unittest.TestCase): - - def setUp(self): - subprocess.Popen(['gstd', '-p', '5000', '-n', '2']) +class TestGstcInitMethods(GstdTestRunner): def test_init(self): - self.gstd_client = GstdClient() + self.gstd_client = GstdClient(port=self.port) def test_init_dummylogger(self): self.gstd_logger = DummyLogger() - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) def test_init_logfile(self): f = open('dummy.log', 'w+') @@ -57,7 +54,7 @@ def test_init_logfile(self): f.close() self.gstd_logger = CustomLogger('test_libgstc', logfile='dummy.log', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) f = open('dummy.log') num_lines_final = sum(1 for line in f) f.close() diff --git a/tests/libgstc/python/test_libgstc_python_list_elements.py b/tests/libgstc/python/test_libgstc_python_list_elements.py index 95b2a49b..edd9613b 100755 --- a/tests/libgstc/python/test_libgstc_python_list_elements.py +++ b/tests/libgstc/python/test_libgstc_python_list_elements.py @@ -31,16 +31,17 @@ import unittest +from gstd_runner import GstdTestRunner from pygstc.gstc import * from pygstc.logger import * -class TestGstcListElementsMethods(unittest.TestCase): +class TestGstcListElementsMethods(GstdTestRunner): def test_list_elements(self): pipeline = 'videotestsrc name=v0 ! fakesink name=x0' self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.pipeline_create('p0', pipeline) self.assertEqual(self.gstd_client.list_elements('p0'), [{'name': 'x0'}, {'name': 'v0'}]) diff --git a/tests/libgstc/python/test_libgstc_python_list_pipelines.py b/tests/libgstc/python/test_libgstc_python_list_pipelines.py index 564c14d8..47cd7c12 100755 --- a/tests/libgstc/python/test_libgstc_python_list_pipelines.py +++ b/tests/libgstc/python/test_libgstc_python_list_pipelines.py @@ -31,16 +31,17 @@ import unittest +from gstd_runner import GstdTestRunner from pygstc.gstc import * from pygstc.logger import * -class TestGstcListPipelinesMethods(unittest.TestCase): +class TestGstcListPipelinesMethods(GstdTestRunner): def test_list_pipelines(self): pipeline = 'videotestsrc name=v0 ! fakesink' self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) initial_n_pipes = len(self.gstd_client.list_pipelines()) self.gstd_client.create('pipelines', 'p0', pipeline) final_n_pipes = len(self.gstd_client.list_pipelines()) diff --git a/tests/libgstc/python/test_libgstc_python_list_properties.py b/tests/libgstc/python/test_libgstc_python_list_properties.py index fdee9375..52888044 100755 --- a/tests/libgstc/python/test_libgstc_python_list_properties.py +++ b/tests/libgstc/python/test_libgstc_python_list_properties.py @@ -31,17 +31,18 @@ import unittest +from gstd_runner import GstdTestRunner from pygstc.gstc import * from pygstc.logger import * -class TestGstcListPropertiesMethods(unittest.TestCase): +class TestGstcListPropertiesMethods(GstdTestRunner): def test_list_properties(self): pipeline = \ 'videotestsrc name=v0 ! identity name=i0 ! fakesink name=x0' self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) identity_properties = [ {'name': 'name'}, {'name': 'parent'}, diff --git a/tests/libgstc/python/test_libgstc_python_list_signals.py b/tests/libgstc/python/test_libgstc_python_list_signals.py index 5d202345..1676920c 100755 --- a/tests/libgstc/python/test_libgstc_python_list_signals.py +++ b/tests/libgstc/python/test_libgstc_python_list_signals.py @@ -31,20 +31,21 @@ import unittest +from gstd_runner import GstdTestRunner from pygstc.gstc import * from pygstc.logger import * -class TestGstcListSignalsMethods(unittest.TestCase): +class TestGstcListSignalsMethods(GstdTestRunner): def test_list_signals(self): pipeline = \ 'videotestsrc name=v0 ! identity name=i0 ! fakesink name=x0' self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.pipeline_create('p0', pipeline) - self.assertEqual(self.gstd_client.list_signals('p0', 'i0'), - [{'name': 'handoff'}]) + self.assertTrue({'name': 'handoff'} in + self.gstd_client.list_signals('p0', 'i0')) self.gstd_client.pipeline_delete('p0') diff --git a/tests/libgstc/python/test_libgstc_python_pipeline_create.py b/tests/libgstc/python/test_libgstc_python_pipeline_create.py index c7949de1..76ece076 100755 --- a/tests/libgstc/python/test_libgstc_python_pipeline_create.py +++ b/tests/libgstc/python/test_libgstc_python_pipeline_create.py @@ -31,16 +31,17 @@ import unittest +from gstd_runner import GstdTestRunner from pygstc.gstc import * from pygstc.logger import * -class TestGstcPipelineCreateMethods(unittest.TestCase): +class TestGstcPipelineCreateMethods(GstdTestRunner): def test_libgstc_python_pipeline_create(self): pipeline = 'videotestsrc name=v0 ! fakesink' self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.pipeline_create('p0', pipeline) ret = self.gstd_client.read('pipelines') self.assertEqual(ret['nodes'][0]['name'], 'p0') diff --git a/tests/libgstc/python/test_libgstc_python_pipeline_delete.py b/tests/libgstc/python/test_libgstc_python_pipeline_delete.py index 4c447c9a..c65c10d0 100755 --- a/tests/libgstc/python/test_libgstc_python_pipeline_delete.py +++ b/tests/libgstc/python/test_libgstc_python_pipeline_delete.py @@ -31,16 +31,17 @@ import unittest +from gstd_runner import GstdTestRunner from pygstc.gstc import * from pygstc.logger import * -class TestGstcPipelineDeleteMethods(unittest.TestCase): +class TestGstcPipelineDeleteMethods(GstdTestRunner): def test_libgstc_python_pipeline_delete(self): pipeline = 'videotestsrc name=v0 ! fakesink' self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.pipeline_create('p0', pipeline) ret_prev = self.gstd_client.read('pipelines') len_prev = len(ret_prev['nodes']) diff --git a/tests/libgstc/python/test_libgstc_python_pipeline_pause.py b/tests/libgstc/python/test_libgstc_python_pipeline_pause.py index d0c6e406..a1cb16e3 100755 --- a/tests/libgstc/python/test_libgstc_python_pipeline_pause.py +++ b/tests/libgstc/python/test_libgstc_python_pipeline_pause.py @@ -29,23 +29,34 @@ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED # OF THE POSSIBILITY OF SUCH DAMAGE. +import time import unittest +from gstd_runner import GstdTestRunner from pygstc.gstc import * from pygstc.logger import * +DEFAULT_STATE_READ_RETRIES = 3 +DEFAULT_TIME_BETWEEN_RETRIES = 0.1 #seconds +RUN_STATES = ['RUNNING', 'running,', 'READY', 'ready'] -class TestGstcPipelinePauseMethods(unittest.TestCase): +class TestGstcPipelinePauseMethods(GstdTestRunner): def test_libgstc_python_pipeline_pause(self): pipeline = 'videotestsrc name=v0 ! fakesink' self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.pipeline_create('p0', pipeline) self.gstd_client.pipeline_play('p0') self.gstd_client.pipeline_pause('p0') - self.assertEqual(self.gstd_client.read( - 'pipelines/p0/state')['value'], 'PAUSED') + state = self.gstd_client.read('pipelines/p0/state')['value'] + retry = DEFAULT_STATE_READ_RETRIES + while (retry and state in RUN_STATES): + time.sleep(DEFAULT_TIME_BETWEEN_RETRIES) + state = self.gstd_client.read('pipelines/p0/state')['value'] + retry -= 1 + self.assertIn(self.gstd_client.read( + 'pipelines/p0/state')['value'], ['PAUSED', 'paused']) self.gstd_client.pipeline_delete('p0') diff --git a/tests/libgstc/python/test_libgstc_python_pipeline_play.py b/tests/libgstc/python/test_libgstc_python_pipeline_play.py index 86a5eafd..1e245d83 100755 --- a/tests/libgstc/python/test_libgstc_python_pipeline_play.py +++ b/tests/libgstc/python/test_libgstc_python_pipeline_play.py @@ -32,21 +32,22 @@ import time import unittest +from gstd_runner import GstdTestRunner from pygstc.gstc import * from pygstc.logger import * -class TestGstcPipelinePlayMethods(unittest.TestCase): +class TestGstcPipelinePlayMethods(GstdTestRunner): def test_libgstc_python_pipeline_play(self): pipeline = 'videotestsrc name=v0 ! fakesink' self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.pipeline_create('p0', pipeline) self.gstd_client.pipeline_play('p0') time.sleep(0.1) self.assertIn(self.gstd_client.read('pipelines/p0/state') - ['value'], ['PLAYING']) + ['value'], ['PLAYING', 'playing']) self.gstd_client.pipeline_stop('p0') self.gstd_client.pipeline_delete('p0') diff --git a/tests/libgstc/python/test_libgstc_python_pipeline_stop.py b/tests/libgstc/python/test_libgstc_python_pipeline_stop.py index 274863d8..fb6733e5 100755 --- a/tests/libgstc/python/test_libgstc_python_pipeline_stop.py +++ b/tests/libgstc/python/test_libgstc_python_pipeline_stop.py @@ -31,21 +31,22 @@ import unittest +from gstd_runner import GstdTestRunner from pygstc.gstc import * from pygstc.logger import * -class TestGstcPipelineStopMethods(unittest.TestCase): +class TestGstcPipelineStopMethods(GstdTestRunner): def test_libgstc_python_pipeline_stop(self): pipeline = 'videotestsrc name=v0 ! fakesink' self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.pipeline_create('p0', pipeline) self.gstd_client.pipeline_play('p0') self.gstd_client.pipeline_stop('p0') - self.assertEqual(self.gstd_client.read( - 'pipelines/p0/state')['value'], 'NULL') + self.assertIn(self.gstd_client.read( + 'pipelines/p0/state')['value'], ['NULL', 'null']) self.gstd_client.pipeline_delete('p0') diff --git a/tests/libgstc/python/test_libgstc_python_read.py b/tests/libgstc/python/test_libgstc_python_read.py index de8e40ae..5ae22b9a 100755 --- a/tests/libgstc/python/test_libgstc_python_read.py +++ b/tests/libgstc/python/test_libgstc_python_read.py @@ -31,20 +31,21 @@ import unittest +from gstd_runner import GstdTestRunner from pygstc.gstc import * from pygstc.logger import * -class TestGstcReadMethods(unittest.TestCase): +class TestGstcReadMethods(GstdTestRunner): def test_libgstc_python_read(self): pipeline = 'videotestsrc name=v0 pattern=ball ! fakesink' self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.pipeline_create('p0', pipeline) ret = self.gstd_client.read( 'pipelines/p0/elements/v0/properties/pattern') - self.assertEqual(ret['value'], 'Moving ball') + self.assertIn(ret['value'], ['Moving ball', 'ball']) self.gstd_client.pipeline_stop('p0') self.gstd_client.pipeline_delete('p0') diff --git a/tests/libgstc/python/test_libgstc_python_signal_connect.py b/tests/libgstc/python/test_libgstc_python_signal_connect.py index 1d29058f..276156c3 100755 --- a/tests/libgstc/python/test_libgstc_python_signal_connect.py +++ b/tests/libgstc/python/test_libgstc_python_signal_connect.py @@ -31,17 +31,18 @@ import unittest +from gstd_runner import GstdTestRunner from pygstc.gstc import * from pygstc.logger import * -class TestGstcSignalConnectMethods(unittest.TestCase): +class TestGstcSignalConnectMethods(GstdTestRunner): def test_libgstc_python_signal_connect(self): pipeline = \ 'videotestsrc ! identity signal-handoffs=true name=identity ! fakesink' self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.pipeline_create('p0', pipeline) self.gstd_client.pipeline_play('p0') ret = self.gstd_client.signal_connect('p0', 'identity', diff --git a/tests/libgstc/python/test_libgstc_python_signal_disconnect.py b/tests/libgstc/python/test_libgstc_python_signal_disconnect.py index d017846e..7abc41a3 100755 --- a/tests/libgstc/python/test_libgstc_python_signal_disconnect.py +++ b/tests/libgstc/python/test_libgstc_python_signal_disconnect.py @@ -32,6 +32,7 @@ import unittest import threading +from gstd_runner import GstdTestRunner from pygstc.gstc import * from pygstc.logger import * import time @@ -40,22 +41,22 @@ ret_val = '' -def signal_connect_test(): +def signal_connect_test(port): global ret_val gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - gstd_client = GstdClient(logger=gstd_logger) + gstd_client = GstdClient(port=port, logger=gstd_logger) ret_val = gstd_client.signal_connect('p0', 'identity', 'handoff') -class TestGstcSignalDisconnectMethods(unittest.TestCase): +class TestGstcSignalDisconnectMethods(GstdTestRunner): def test_libgstc_python_signal_disconnect(self): global ret_val pipeline = 'videotestsrc ! identity name=identity ! fakesink' self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.pipeline_create('p0', pipeline) - ret_thr = threading.Thread(target=signal_connect_test) + ret_thr = threading.Thread(target=signal_connect_test, args=(self.port,)) ret_thr.start() time.sleep(0.1) self.gstd_client.signal_disconnect('p0', 'identity', 'handoff') diff --git a/tests/libgstc/python/test_libgstc_python_signal_timeout.py b/tests/libgstc/python/test_libgstc_python_signal_timeout.py index 17c7c157..297ee336 100755 --- a/tests/libgstc/python/test_libgstc_python_signal_timeout.py +++ b/tests/libgstc/python/test_libgstc_python_signal_timeout.py @@ -32,16 +32,17 @@ import unittest import threading +from gstd_runner import GstdTestRunner from pygstc.gstc import * from pygstc.logger import * -class TestGstcSignalTimeoutMethods(unittest.TestCase): +class TestGstcSignalTimeoutMethods(GstdTestRunner): def test_libgstc_python_signal_timeout(self): pipeline = 'videotestsrc ! identity name=identity ! fakesink' self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.pipeline_create('p0', pipeline) self.gstd_client.signal_timeout('p0', 'identity', 'handoff', 1) ret_con = self.gstd_client.signal_connect('p0', 'identity', diff --git a/tests/libgstc/python/test_libgstc_python_stop_gstd.py b/tests/libgstc/python/test_libgstc_python_stop_gstd.py index b358aa10..b3cfc06f 100755 --- a/tests/libgstc/python/test_libgstc_python_stop_gstd.py +++ b/tests/libgstc/python/test_libgstc_python_stop_gstd.py @@ -32,11 +32,13 @@ import unittest import subprocess +from gstd_runner import GstdTestRunner -class TestGstcStopGstdMethods(unittest.TestCase): + +class TestGstcStopGstdMethods(GstdTestRunner): def test_libgstc_python_stop_gstd(self): - subprocess.Popen(['gstd', '-k']) + subprocess.Popen([self.gstd_path, '-k']) if __name__ == '__main__': diff --git a/tests/libgstc/python/test_libgstc_python_update.py b/tests/libgstc/python/test_libgstc_python_update.py index b6e18c9e..7d0821ad 100755 --- a/tests/libgstc/python/test_libgstc_python_update.py +++ b/tests/libgstc/python/test_libgstc_python_update.py @@ -31,22 +31,23 @@ import unittest +from gstd_runner import GstdTestRunner from pygstc.gstc import * from pygstc.logger import * -class TestGstcUpdateMethods(unittest.TestCase): +class TestGstcUpdateMethods(GstdTestRunner): def test_libgstc_python_update(self): pipeline = 'videotestsrc name=v0 pattern=snow ! fakesink' self.gstd_logger = CustomLogger('test_libgstc', loglevel='DEBUG') - self.gstd_client = GstdClient(logger=self.gstd_logger) + self.gstd_client = GstdClient(port=self.port, logger=self.gstd_logger) self.gstd_client.pipeline_create('p0', pipeline) self.gstd_client.update( 'pipelines/p0/elements/v0/properties/pattern', 'ball') ret = self.gstd_client.read( 'pipelines/p0/elements/v0/properties/pattern') - self.assertEqual(ret['value'], 'Moving ball') + self.assertIn(ret['value'], ['Moving ball', 'ball']) self.gstd_client.pipeline_stop('p0') self.gstd_client.pipeline_delete('p0') diff --git a/tests/libgstd/Makefile.am b/tests/libgstd/Makefile.am index 9b41d26c..dd465919 100644 --- a/tests/libgstd/Makefile.am +++ b/tests/libgstd/Makefile.am @@ -7,7 +7,8 @@ TESTS = \ check_PROGRAMS = $(TESTS) -AM_CFLAGS = $(GST_CFLAGS) \ +AM_CFLAGS = $(GSTD_CFLAGS) \ + $(GST_CFLAGS) \ -I$(top_srcdir)/gstd/ \ $(GIO_CFLAGS) \ $(GIO_UNIX_CFLAGS) \ @@ -18,5 +19,11 @@ AM_CFLAGS = $(GST_CFLAGS) \ $(JANSSON_CFLAGS) -pthread \ -I$(top_srcdir)/libgstd -AM_LDFLAGS = $(GST_LIBS) $(GIO_LIBS) $(GJSON_LIBS) $(LIBSOUP_LIBS) $(JANSSON_LIBS) +AM_LDFLAGS = \ + $(GSTD_LIBS) \ + $(GST_LIBS) \ + $(GIO_LIBS) \ + $(GJSON_LIBS) \ + $(LIBSOUP_LIBS) \ + $(JANSSON_LIBS) LDADD = $(top_srcdir)/libgstd/libgstd-@GSTD_API_VERSION@.la diff --git a/tests/libgstd/test_libgstd_create.c b/tests/libgstd/test_libgstd_create.c index 43e6104d..e6879e36 100644 --- a/tests/libgstd/test_libgstd_create.c +++ b/tests/libgstd/test_libgstd_create.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2021 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include diff --git a/tests/libgstd/test_libgstd_delete.c b/tests/libgstd/test_libgstd_delete.c index c3fdc929..aebc8dea 100644 --- a/tests/libgstd/test_libgstd_delete.c +++ b/tests/libgstd/test_libgstd_delete.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2021 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include diff --git a/tests/libgstd/test_libgstd_init.c b/tests/libgstd/test_libgstd_init.c index b717f6e5..4f8aaf9c 100644 --- a/tests/libgstd/test_libgstd_init.c +++ b/tests/libgstd/test_libgstd_init.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2021 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include diff --git a/tests/libgstd/test_libgstd_read.c b/tests/libgstd/test_libgstd_read.c index 4b24941b..6dbd7c21 100644 --- a/tests/libgstd/test_libgstd_read.c +++ b/tests/libgstd/test_libgstd_read.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2021 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include diff --git a/tests/libgstd/test_libgstd_update.c b/tests/libgstd/test_libgstd_update.c index 0923324d..27cc45a4 100644 --- a/tests/libgstd/test_libgstd_update.c +++ b/tests/libgstd/test_libgstd_update.c @@ -1,20 +1,21 @@ /* - * GStreamer Daemon - Gst Launch under steroids - * Copyright (c) 2015-2021 Ridgerun, LLC (http://www.ridgerun.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of GStreamer Daemon + * Copyright 2015-2022 Ridgerun, LLC (http://www.ridgerun.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. */ #include