Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Header-comments cleanup. Unused includes cleanup #8

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
674 changes: 0 additions & 674 deletions gst-h264-encryption/COPYING

This file was deleted.

30 changes: 14 additions & 16 deletions gst-h264-encryption/src/h264_decrypt.c
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
/*
* GStreamer
* Copyright (C) 2006 Stefan Kost <[email protected]>
* Copyright (C) 2024 root <<[email protected]>>
* GStreamer H264 Encryption Plugin
*
* 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.
* Copyright (C) 2024 Oguzhan Oztaskin <[email protected]>
*
* This library is distributed in the hope that it will be useful,
* 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 3 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
* Library General Public License for more details.
* 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 Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/**
Expand Down Expand Up @@ -60,9 +58,9 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE(
GST_STATIC_CAPS("video/x-h264,alignment=au,stream-format=byte-stream"));

#define gst_h264_decrypt_parent_class parent_class
G_DEFINE_TYPE(GstH264Decrypt, gst_h264_decrypt, GST_TYPE_H264_ENCRYPTION_BASE);
G_DEFINE_TYPE(GstH264Decrypt, gst_h264_decrypt, GST_TYPE_H264_ENCRYPTION_BASE)
GST_ELEMENT_REGISTER_DEFINE(h264decrypt, "h264decrypt", GST_RANK_NONE,
GST_TYPE_H264_DECRYPT);
GST_TYPE_H264_DECRYPT)

static GstFlowReturn gst_h264_decrypt_prepare_output_buffer(
GstBaseTransform *trans, GstBuffer *input, GstBuffer **outbuf);
Expand Down
38 changes: 15 additions & 23 deletions gst-h264-encryption/src/h264_decrypt.h
Original file line number Diff line number Diff line change
@@ -1,36 +1,28 @@
/*
* GStreamer
* Copyright (C) 2006 Stefan Kost <[email protected]>
* Copyright (C) 2020 Niels De Graef <[email protected]>
* Copyright (C) 2024 root <<[email protected]>>
* GStreamer H264 Encryption Plugin
*
* 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.
* Copyright (C) 2024 Oguzhan Oztaskin <[email protected]>
*
* This library is distributed in the hope that it will be useful,
* 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 3 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
* Library General Public License for more details.
* 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 Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

#ifndef __GST_H264DECRYPT_H__
#define __GST_H264DECRYPT_H__
#ifndef __GST_H264_DECRYPT_H__
#define __GST_H264_DECRYPT_H__

#include <gst/base/gstbasetransform.h>
#include <gst/codecparsers/gsth264parser.h>
#include <gst/gst.h>

#include "ciphers/aes.h"
#include "h264_encryption_base.h"
#include "h264_encryption_mode.h"
#include "h264_encryption_types.h"

G_BEGIN_DECLS

Expand All @@ -57,4 +49,4 @@ struct _GstH264Decrypt {

G_END_DECLS

#endif /* __GST_H264DECRYPT_H__ */
#endif /* __GST_H264_DECRYPT_H__ */
32 changes: 15 additions & 17 deletions gst-h264-encryption/src/h264_encrypt.c
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
/*
* GStreamer
* Copyright (C) 2006 Stefan Kost <[email protected]>
* Copyright (C) 2024 root <<[email protected]>>
* GStreamer H264 Encryption Plugin
*
* 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.
* Copyright (C) 2024 Oguzhan Oztaskin <[email protected]>
*
* This library is distributed in the hope that it will be useful,
* 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 3 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
* Library General Public License for more details.
* 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 Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/**
Expand All @@ -36,7 +34,7 @@
#include "config.h"
#endif

#include <errno.h>
#include <errno.h> // for: errno, strerror()
#include <gst/base/base.h>
#include <gst/codecparsers/gsth264parser.h>
#include <gst/controller/controller.h>
Expand Down Expand Up @@ -71,9 +69,9 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE(
GST_STATIC_CAPS("video/x-h264,alignment=au,stream-format=byte-stream"));

#define gst_h264_encrypt_parent_class parent_class
G_DEFINE_TYPE(GstH264Encrypt, gst_h264_encrypt, GST_TYPE_H264_ENCRYPTION_BASE);
G_DEFINE_TYPE(GstH264Encrypt, gst_h264_encrypt, GST_TYPE_H264_ENCRYPTION_BASE)
GST_ELEMENT_REGISTER_DEFINE(h264encrypt, "h264encrypt", GST_RANK_NONE,
GST_TYPE_H264_ENCRYPT);
GST_TYPE_H264_ENCRYPT)

static GstMemory *gst_h264_encrypt_create_iv_sei_memory(
guint start_code_prefix_length, const guint8 *iv, guint iv_size);
Expand Down
43 changes: 18 additions & 25 deletions gst-h264-encryption/src/h264_encrypt.h
Original file line number Diff line number Diff line change
@@ -1,37 +1,30 @@
/*
* GStreamer
* Copyright (C) 2006 Stefan Kost <[email protected]>
* Copyright (C) 2020 Niels De Graef <[email protected]>
* Copyright (C) 2024 root <<[email protected]>>
* GStreamer H264 Encryption Plugin
*
* 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.
* Copyright (C) 2024 Oguzhan Oztaskin <[email protected]>
*
* This library is distributed in the hope that it will be useful,
* 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 3 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
* Library General Public License for more details.
* 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 Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

#ifndef __GST_H264ENCRYPT_H__
#define __GST_H264ENCRYPT_H__
#ifndef __GST_H264_ENCRYPT_H__
#define __GST_H264_ENCRYPT_H__

#include <gst/base/gstbasetransform.h>
#include <gst/codecparsers/gsth264parser.h>
#include <gst/gst.h>
#include <stdlib.h>

#include "ciphers/aes.h"
#include <stdint.h> // for: uint8_t

#include "h264_encryption_base.h"
#include "h264_encryption_mode.h"
#include "h264_encryption_types.h"

G_BEGIN_DECLS

Expand Down Expand Up @@ -71,7 +64,7 @@ struct _GstH264EncryptClass {
GstH264EncryptionBaseClass parent_class;

/* Signals */
/* NOTE For performance, these can be replaced with callbacks, ie.
/* NOTE: For performance, these can be replaced with callbacks, ie.
* gst_app_sink_set_callbacks.
*/
gboolean (*iv)(GstH264Encrypt *encrypt, uint8_t *iv, guint block_length);
Expand All @@ -93,4 +86,4 @@ struct _GstH264Encrypt {

G_END_DECLS

#endif /* __GST_H264ENCRYPT_H__ */
#endif /* __GST_H264_ENCRYPT_H__ */
31 changes: 14 additions & 17 deletions gst-h264-encryption/src/h264_encryption_base.c
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
/*
* GStreamer
* Copyright (C) 2006 Stefan Kost <[email protected]>
* Copyright (C) 2024 root <<[email protected]>>
* GStreamer H264 Encryption Plugin
*
* 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.
* Copyright (C) 2024 Oguzhan Oztaskin <[email protected]>
*
* This library is distributed in the hope that it will be useful,
* 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 3 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
* Library General Public License for more details.
* 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 Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/**
Expand Down Expand Up @@ -45,7 +43,6 @@
#include "h264_encryption_base.h"
#include "h264_encryption_base_private.h"
#include "h264_encryption_mode.h"
#include "h264_encryption_plugin.h"
#include "h264_encryption_types.h"

GST_DEBUG_CATEGORY_STATIC(gst_h264_encryption_base_debug);
Expand All @@ -59,9 +56,9 @@ struct _GstH264EncryptionBasePrivate {
GstH264EncryptionUtils utils;
};
G_DEFINE_TYPE_WITH_PRIVATE(GstH264EncryptionBase, gst_h264_encryption_base,
GST_TYPE_BASE_TRANSFORM);
GST_TYPE_BASE_TRANSFORM)
GST_ELEMENT_REGISTER_DEFINE(h264encryptionbase, "h264encryptionbase",
GST_RANK_NONE, GST_TYPE_H264_ENCRYPTION_BASE);
GST_RANK_NONE, GST_TYPE_H264_ENCRYPTION_BASE)

static void gst_h264_encryption_base_set_property(GObject *object,
guint prop_id,
Expand Down
41 changes: 17 additions & 24 deletions gst-h264-encryption/src/h264_encryption_base.h
Original file line number Diff line number Diff line change
@@ -1,36 +1,29 @@
/*
* GStreamer
* Copyright (C) 2006 Stefan Kost <[email protected]>
* Copyright (C) 2020 Niels De Graef <[email protected]>
* Copyright (C) 2024 root <<[email protected]>>
* GStreamer H264 Encryption Plugin
*
* 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.
* Copyright (C) 2024 Oguzhan Oztaskin <[email protected]>
*
* This library is distributed in the hope that it will be useful,
* 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 3 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
* Library General Public License for more details.
* 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 Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

#ifndef __GST_H264ENCRYPTIONBASE_H__
#define __GST_H264ENCRYPTIONBASE_H__
#ifndef __GST_H264_ENCRYPTION_BASE_H__
#define __GST_H264_ENCRYPTION_BASE_H__

#include <gst/base/gstbasetransform.h>
#include <gst/codecparsers/gsth264parser.h>
#include <gst/base/gstbasetransform.h> // for: GstBaseTransform, GstBaseTransformClass
#include <gst/codecparsers/gsth264parser.h> // for: GstH264NalParser, GstH264NalUnit
#include <gst/gst.h>

#include "ciphers/aes.h"
#include "h264_encryption_mode.h"
#include "h264_encryption_types.h"

G_BEGIN_DECLS

/**
Expand Down Expand Up @@ -75,4 +68,4 @@ gboolean gst_h264_encryption_base_calculate_payload_offset_and_size(

G_END_DECLS

#endif /* __GST_H264ENCRYPTIONBASE_H__ */
#endif /* __GST_H264_ENCRYPTION_BASE_H__ */
Loading